Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
328 views
in Technique[技术] by (71.8m points)

java - If my app target sdk ver is 30 how can it works in phone with lower sdk

when I try to run it in lower it shows these errors. so what can I do?

java.lang.SecurityException: getSerial: The user 10368 does not meet the requirements to access device identifiers.
    at android.os.Parcel.createException(Parcel.java:2074)
    at android.os.Parcel.readException(Parcel.java:2042)
    at android.os.Parcel.readException(Parcel.java:1990)
    at android.os.IDeviceIdentifiersPolicyService$Stub$Proxy.getSerialForPackage(IDeviceIdentifiersPolicyService.java:159)
    at android.os.Build.getSerial(Build.java:162)
    at com.mak.share.util.AppUtils.getDeviceSerial(AppUtils.java:185)
    at com.mak.share.util.AppUtils.getLocalDevice(AppUtils.java:215)
    at com.mak.share.activity.MainActivity.createHeaderView(MainActivity.java:300)
    at com.mak.share.activity.MainActivity.onStart(MainActivity.java:116)
    at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1433)
    at android.app.Activity.performStart(Activity.java:7923)
    at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3335)
    at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
    at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
    at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2047)
    at android.os.Handler.dispatchMessage(Handler.java:107)
    at android.os.Looper.loop(Looper.java:224)
    at android.app.ActivityThread.main(ActivityThread.java:7592)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
Caused by: android.os.RemoteException: Remote stack trace:
    at com.android.internal.telephony.TelephonyPermissions.reportAccessDeniedToReadIdentifiers(TelephonyPermissions.java:421)
    at com.android.internal.telephony.TelephonyPermissions.checkReadDeviceIdentifiers(TelephonyPermissions.java:353)
    at com.android.internal.telephony.TelephonyPermissions.checkCallingOrSelfReadDeviceIdentifiers(TelephonyPermissions.java:278)
    at com.android.internal.telephony.TelephonyPermissions.checkCallingOrSelfReadDeviceIdentifiers(TelephonyPermissions.java:255)
    at com.android.server.os.DeviceIdentifiersPolicyService$DeviceIdentifiersPolicy.getSerialForPackage(DeviceIdentifiersPolicyService.java:67)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...