21

I'm using Settings.ACTION_APPLICATION_DETAILS_SETTINGS in order to request when the user does not grant permission in purpose.

Intent intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", getActivity().getPackageName(), null);
intent.setData(uri);
getActivity().startActivity(intent);

The code works well only under android 13. If i run this code in Android 13, It happens an exception.

 "Bad call made by uid 1000. Package "package name" does not belong to uid -1.
noteOperation
java.lang.SecurityException: Specified package "package name" under uid -1 but it is not
at com.android.server.appop.AppOpsService.verifyAndGetBypass(AppOpsService.java:4858)
at com.android.server.appop.AppOpsService.noteOperationUnchecked(AppOpsService.java:3586)
at com.android.server.appop.AppOpsService.noteOperationImpl(AppOpsService.java:3574)
at com.android.server.appop.AppOpsService.-$$Nest$mnoteOperationImpl(Unknown Source:0)
at com.android.server.appop.AppOpsService$CheckOpsDelegateDispatcher.lambda$noteOperation$4(AppOpsService.java:7928)
at com.android.server.appop.AppOpsService$CheckOpsDelegateDispatcher.$r8$lambda$oOwUoG55BBmJ6yiwhp3OAq3tQ30(Unknown Source:0)
at com.android.server.appop.AppOpsService$CheckOpsDelegateDispatcher$$ExternalSyntheticLambda4.apply(Unknown Source:32)
at com.android.server.policy.AppOpsPolicy.noteOperation(AppOpsPolicy.java:225)
at com.android.server.appop.AppOpsService$CheckOpsDelegateDispatcher.noteOperation(AppOpsService.java:7926)
at com.android.server.appop.AppOpsService.noteOperation(AppOpsService.java:3558)
at com.android.internal.app.IAppOpsService$Stub.onTransact(IAppOpsService.java:486)
at android.os.Binder.execTransactInternal(Binder.java:1316)
at android.os.Binder.execTransact(Binder.java:1280)"

I already set android:exported="true" in AndroidManifest.xml. I don't know why the error happens.
I hope someone tells me about the exception.

5
  • Meet the same error. Have you found a root cause? Commented Sep 5, 2023 at 13:05
  • Not yet :( Someone posted this issue on Google Issue tracker. but they ignored it.. Commented Sep 6, 2023 at 5:29
  • I got the same error. It seems that might have happened for security reasons that may not compile with android 13 or above. Commented Mar 7, 2024 at 10:29
  • 2
    @CodingBruceLee Where's the link to the issue tracker post? Commented Mar 30, 2024 at 18:53
  • still no answers? Commented Dec 8, 2024 at 10:51

2 Answers 2

0

I got this when I changed my environment by upgrading my NDK and SDK. I reverted back to ndk version 25.2.9519653 and the issue was fixed for me. I may also have reverted my sdk.

Sign up to request clarification or add additional context in comments.

Comments

0

What I found which fixed this problem when I hit it was to add the following to my AndroidManifest.xml file:

    <application
        android:name=".VariantApp"

where "VariantApp" is the name of the class that extends android.app.Application in my project.

In my case, at least, I had added a dependency on Koin for dependency injection and that caused the issue to appear.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.