SudoPlz / sp-react-native-in-app-updates

An in-app updater for the native version of your react-native app.
MIT License
491 stars 66 forks source link

One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts #187

Open KrushnaNaghate opened 2 months ago

KrushnaNaghate commented 2 months ago

Recently i updated the tagetSdkversion of my Project to 34 to meet play console policy, but I got this crash in Firebase


Fatal Exception: java.lang.SecurityException: com.MyAppName.app: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
       at android.os.Parcel.createExceptionOrNull(Parcel.java:3057)
       at android.os.Parcel.createException(Parcel.java:3041)
       at android.os.Parcel.readException(Parcel.java:3024)
       at android.os.Parcel.readException(Parcel.java:2966)
       at android.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature(IActivityManager.java:5684)
       at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1852)
       at android.app.ContextImpl.registerReceiver(ContextImpl.java:1792)
       at android.app.ContextImpl.registerReceiver(ContextImpl.java:1780)
       at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:755)
       at com.google.android.play.core.appupdate.internal.zzl.zze(com.google.android.play:app-update@@2.0.1:4)
       at com.google.android.play.core.appupdate.internal.zzl.zzb(com.google.android.play:app-update@@2.0.1:4)
       at com.google.android.play.core.appupdate.zzg.registerListener(com.google.android.play:app-update@@2.0.1:1)
       at com.sudoplz.rninappupdates.SpReactNativeInAppUpdatesModule.<init>(SpReactNativeInAppUpdatesModule.java:50)
       at com.sudoplz.rninappupdates.SpReactNativeInAppUpdatesPackage.createNativeModules(SpReactNativeInAppUpdatesPackage.java:19)
       at com.facebook.react.ReactPackageHelper.getNativeModuleIterator(ReactPackageHelper.java:42)
       at com.facebook.react.NativeModuleRegistryBuilder.processPackage(NativeModuleRegistryBuilder.java:42)
       at com.facebook.react.ReactInstanceManager.processPackage(ReactInstanceManager.java:1467)
       at com.facebook.react.ReactInstanceManager.processPackages(ReactInstanceManager.java:1438)
       at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1340)
       at com.facebook.react.ReactInstanceManager.-$$Nest$mcreateReactContext()
       at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1111)
       at java.lang.Thread.run(Thread.java:1012)

```.   need solutions for this 
rohangl commented 4 weeks ago

I have the same issue @SudoPlz

rohangl commented 4 weeks ago

@KrushnaNaghate https://stackoverflow.com/a/78958945 Try this fix, worked for me