5

Trying to build a previously working app on Samsung Note 8 phone , This is the error Permission Denial: broadcast from android asks to run as user -1 but is calling from user 0

  • Not working on Samsung Note 8 , Android version 9
  • Working on Mi A3 , Android Version 11

Now I understand INTERACT_ACROSS_USERS_FULL permissions are required by only system apps accessing system functionalities . This app of mine was working properly before , upgraded flutter and dart versions , also upgraded the Mobile OS .

Even added these permissions in all manifest files , still not working ,

<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS"/> <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL"/> 

Tried this SO also , even worked once by tweaking the developer options on phone as I put an answer here tweaking developer options but now that also is not working .

This is my flutter doctor out ,

[✓] Flutter (Channel master, 2.6.0-1.0.pre.153, on macOS 11.5.1 20G80 darwin-x64, locale en-IN) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) [✓] Xcode - develop for iOS and macOS (Xcode 12.4) [✓] Chrome - develop for the web [✓] Android Studio (version 2020.3) [✓] Connected device (2 available) 

And the Full error is like this ,

D/vndksupport( 5675): Loading /vendor/lib64/hw/[email protected] from current namespace instead of sphal namespace. E/flutter ( 5675): [ERROR:flutter/fml/platform/android/jni_util.cc(182)] java.lang.SecurityException: Permission Denial: broadcast from android asks to run as user -1 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL or android.permission.INTERACT_ACROSS_USERS E/flutter ( 5675): at android.os.Parcel.createException(Parcel.java:1966) E/flutter ( 5675): at android.os.Parcel.readException(Parcel.java:1934) E/flutter ( 5675): at android.os.Parcel.readException(Parcel.java:1884) E/flutter ( 5675): at android.app.IActivityManager$Stub$Proxy.reportActivityFullyDrawn(IActivityManager.java:7312) E/flutter ( 5675): at android.app.Activity.reportFullyDrawn(Activity.java:2092) E/flutter ( 5675): at io.flutter.embedding.android.FlutterActivity.onFlutterUiDisplayed(FlutterActivity.java:1100) E/flutter ( 5675): at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate$1.onFlutterUiDisplayed(FlutterActivityAndFragmentDelegate.java:88) E/flutter ( 5675): at io.flutter.embedding.android.FlutterView$2.onFlutterUiDisplayed(FlutterView.java:133) E/flutter ( 5675): at io.flutter.embedding.engine.FlutterJNI.onFirstFrame(FlutterJNI.java:462) E/flutter ( 5675): at android.os.MessageQueue.nativePollOnce(Native Method) E/flutter ( 5675): at android.os.MessageQueue.next(MessageQueue.java:326) E/flutter ( 5675): at android.os.Looper.loop(Looper.java:181) E/flutter ( 5675): at android.app.ActivityThread.main(ActivityThread.java:7073) E/flutter ( 5675): at java.lang.reflect.Method.invoke(Native Method) E/flutter ( 5675): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494) E/flutter ( 5675): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965) E/flutter ( 5675): Caused by: android.os.RemoteException: Remote stack trace: E/flutter ( 5675): at com.android.server.am.UserController.handleIncomingUser(UserController.java:1818) E/flutter ( 5675): at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:25789) E/flutter ( 5675): at com.android.server.am.ActivityManagerService.broadcastIntentLocked(ActivityManagerService.java:25720) E/flutter ( 5675): at com.android.server.am.ActivityManagerService.broadcastIntent(ActivityManagerService.java:26590) E/flutter ( 5675): at android.app.ContextImpl.sendBroadcastAsUser(ContextImpl.java:1264) E/flutter ( 5675): E/flutter ( 5675): F/flutter ( 5675): [FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(1220)] Check failed: fml::jni::CheckException(env). F/libc ( 5675): Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 5675 (bro.neighbroapp), pid 5675 (bro.neighbroapp) 
3
  • Also ran into this after updating an old plugin to v2. Did you find a solution? Commented Sep 9, 2021 at 11:13
  • Same issue here with Galaxy S7 / Android 8. Worked yesterday, stopped working today. I have no idea what caused this. No issues in my other test device Galaxy A52 / Android 11. Commented Sep 17, 2021 at 18:20
  • I'm getting the same error on a Galaxy Tab S2 (Android 7) with a native app (i.e. not flutter) Commented Sep 26, 2022 at 8:16

2 Answers 2

2

This is an issue with latest Flutter version , I fixed it with the below eidt ,

This is a workaround and it works for me .

  1. go to MainActivity.kt
  2. Import import android.os.Build
  3. Paste this
 override fun onFlutterUiDisplayed() { if (Build.VERSION.SDK_INT >= 100) { //I gave 100 just to confirm , it shoud be android ver 10 reportFullyDrawn(); } } 
  1. flutter clean
  2. flutter run
Sign up to request clarification or add additional context in comments.

5 Comments

I fixed this by restoring <meta-data android:name="io.flutter.embedding.android.SplashScreenDrawable" android:resource="@drawable/launch_background"/> to the AndroidManifest.xml. I had removed it earlier as per the latest Flutter guideline.
This worked for me. Thanks for posting! Insane that this was needed. How did you find out about this solution?
This did not work for me. Also seems hacky.
Restoring the <meta-data android:name="io.flutter.embedding.android.SplashScreenDrawable" android:resource="@drawable/launch_background"/> does indeed work. But it does cause a fade /flicker from going from the initial splashscreen to the SlapshscreenDrawable, but it prevents a crash :-)
@TjerkW Did you find the solution for that flicker?
0
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { activity.reportFullyDrawn() } 

for native app

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.