I try to share of files in android 11,but i get an exception:
java.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.DOWNLOAD_COMPLETE flg=0x10 pkg=ru.alexanderkozlovskiy.test (has extras) } in ru.alexanderkozlovskiy.test.ActivityMain$loadReciever$1#bbd5a77
at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1572)
at android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run(Unknown Source:2)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:7861)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:600)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
Caused by: java.lang.SecurityException: UID 10415 does not have permission to content://downloads/all_downloads/1199 [user 0] [prefix]
You can see my code on https://github.com/AlexandrKozlovskiy/share_issue. Thanks everybody for any help.
Related
Any one have a suggestion how to solve this error ?
I am trying to run lock task with intent getLaunchIntentForPackage but I have no idea why this error is coming and which type of permission it wants to run this task.
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=com.example.videoplayer cmp=com.example.videoplayer/.MainActivity } from ProcessRecord{fd194a9 7523:com.example.lock/u0a190} (pid=7523, uid=10190) with lockTaskMode=true
at android.os.Parcel.createExceptionOrNull(Parcel.java:2425)
at android.os.Parcel.createException(Parcel.java:2409)
at android.os.Parcel.readException(Parcel.java:2392)
at android.os.Parcel.readException(Parcel.java:2334)
at android.app.IActivityTaskManager$Stub$Proxy.startActivity(IActivityTaskManager.java:2326)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1758)
at android.app.Activity.startActivityForResult(Activity.java:5407)
at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:597)
at android.app.Activity.startActivity(Activity.java:5747)
at com.example.lock.MainActivity.launchApp(MainActivity.kt:110)
at com.example.lock.MainActivity.onCreate$lambda-0(MainActivity.kt:62)
at com.example.lock.MainActivity.$r8$lambda$yGvyKllS4GN5cYzDCcbSf8EdXb0(Unknown Source:0)
at com.example.lock.MainActivity$$ExternalSyntheticLambda0.onClick(Unknown Source:2)
at android.view.View.performClick(View.java:7455)
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1194)
at android.view.View.performClickInternal(View.java:7432)
at android.view.View.access$3700(View.java:835)
at android.view.View$PerformClick.run(View.java:28810)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7842)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
Caused by: android.os.RemoteException: Remote stack trace:
at com.android.server.wm.SafeActivityOptions.checkPermissions(SafeActivityOptions.java:283)
at com.android.server.wm.SafeActivityOptions.getOptions(SafeActivityOptions.java:155)
at com.android.server.wm.ActivityStarter.executeRequest(ActivityStarter.java:1006)
at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:670)
at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1223)
I'm currently running into the same error. The only thing I can hand to you is that it can be solved by using the DevicePolicyManager.setLockTaskPackages as stated on the android site: https://developer.android.com/work/dpc/dedicated-devices/lock-task-mode#allowlist_apps
I have this problem when I try to press the button to start an activity from library(face emotion recognition).
E/AndroidRuntime: FATAL EXCEPTION: main
Process: vokaturi.sampleapp, PID: 1912
java.lang.SecurityException: UID 10245 does not have permission to content://com.lampa.emotionrecognition.fileprovider/my_images/Pictures/ER_20220418_031223_6417256160146127805.jpg [user 0]
at android.os.Parcel.readException(Parcel.java:2029)
at android.os.Parcel.readException(Parcel.java:1975)
at android.app.IActivityManager$Stub$Proxy.startActivity(IActivityManager.java:4842)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1619)
at android.app.Activity.startActivityForResult(Activity.java:4621)
at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:676)
at android.app.Activity.startActivityForResult(Activity.java:4579)
at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:663)
at com.lampa.emotionrecognition.MainActivity.takePhoto(MainActivity.java:167)
at com.lampa.emotionrecognition.MainActivity.access$000(MainActivity.java:49)
at com.lampa.emotionrecognition.MainActivity$1.onClick(MainActivity.java:92)
at android.view.View.performClick(View.java:6935)
at android.widget.TextView.performClick(TextView.java:12787)
at android.view.View$PerformClick.run(View.java:26214)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:7000)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
Hello I am using GCM for push notification, i am getting lot of crashes on Android O
WakefulBroadcastReceiver.java line 99
android.support.v4.content.WakefulBroadcastReceiver.startWakefulService
I am not using FCM for push notification, kindly help me out to fix this issue in Android O. Following is the stacktrace of the error in fabric.
Fatal Exception: java.lang.RuntimeException: Unable to start receiver com.google.firebase.iid.FirebaseInstanceIdInternalReceiver: java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.firebase.INSTANCE_ID_EVENT pkg=com.tapmad.tapmadtv cmp=com.tapmad.tapmadtv/com.google.firebase.iid.FirebaseInstanceIdService (has extras) }: app is in background uid UidRecord{b7ea475 u0a216 RCVR bg:+1m30s74ms idle procs:1 seq(0,0,0)}
at android.app.ActivityThread.handleReceiver(ActivityThread.java:3399)
at android.app.ActivityThread.-wrap18(Unknown Source)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1780)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6944)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
My app integrates FCM to receive push notifications and it works okay. However, I am facing issue that on installation it crashes randomly. It is very random and occurring on OS 6.0+ devices till latest but randomly occurs.
Code wise, in service class only show notification code is written and added service in manifest.
I am getting below exception on app loads
Fatal Exception: java.lang.RuntimeException: Unable to start receiver com.google.firebase.iid.FirebaseInstanceIdInternalReceiver: java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.firebase.INSTANCE_ID_EVENT pkg=com.xx.xx cmp=com.xx.xx/com.google.firebase.iid.FirebaseInstanceIdService (has extras) }: app is in background uid UidRecord{997e286 u0a92 RCVR idle procs:1 seq(0,0,0)}
at android.app.ActivityThread.handleReceiver(ActivityThread.java:3259)
at android.app.ActivityThread.-wrap17(Unknown Source)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1677)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6540)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.firebase.INSTANCE_ID_EVENT pkg=com.xx.xx cmp=com.xx.xx/com.google.firebase.iid.FirebaseInstanceIdService (has extras) }: app is in background uid UidRecord{997e286 u0a92 RCVR idle procs:1 seq(0,0,0)}
at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1497)
at android.app.ContextImpl.startService(ContextImpl.java:1453)
at android.content.ContextWrapper.startService(ContextWrapper.java:644)
at android.content.ContextWrapper.startService(ContextWrapper.java:644)
at android.support.v4.content.WakefulBroadcastReceiver.startWakefulService(WakefulBroadcastReceiver.java:91)
at com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.zzh(Unknown Source:12)
at com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.zzb(Unknown Source:76)
at com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.onReceive(Unknown Source:28)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:3252)
at android.app.ActivityThread.-wrap17(Unknown Source)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1677)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6540)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Use this library version for firebase
compile 'com.google.firebase:firebase-core:11.8.0'
compile 'com.google.firebase:firebase-auth:11.8.0'
compile 'com.google.firebase:firebase-messaging:11.8.0'
Fatal Exception: java.lang.SecurityException: Unable to start service Intent { act=com.google.firebase.crash.internal.service.FirebaseCrashReceiverService.SAVE cmp=com.sample.android/com.google.firebase.crash.internal.service.FirebaseCrashReceiverService (has extras) }: Unable to launch app com.sample.android/10124 for service Intent { act=com.google.firebase.crash.internal.service.FirebaseCrashReceiverService.SAVE cmp=com.sample.android/com.google.firebase.crash.internal.service.FirebaseCrashReceiverService }: process is bad
at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1720)
at android.app.ContextImpl.startService(ContextImpl.java:1693)
at android.content.ContextWrapper.startService(ContextWrapper.java:516)
at aii.run(:com.google.android.gms.DynamiteModulesC:181)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Firebase crash is set up perfectly as we are getting reports of the crashes BUT i'm seeing this on Crashlytics and this ultimately leads to crashing the app.
Does anyone know what this problem is?