Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 14 Error: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts #343

Open
sandeep14 opened this issue Jan 3, 2024 · 4 comments

Comments

@sandeep14
Copy link

getting Below error while uploading video in android

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

Please provide solution for same

@sandeep14
Copy link
Author

Fixed this issue at my end by changing build.gradle file implementation 'net.gotev:uploadservice-okhttp:4.9.2' and kotline version kotlinVersion = '1.8.21' , plus adding plugin id 'kotlin-parcelize' .
**change Version here **
buildToolsVersion = '34.0.8'
compileSdkVersion = 34
targetSdkVersion = 34

@anindya2791 anindya2791 mentioned this issue Mar 12, 2024
5 tasks
uspython added a commit to uspython/react-native-background-upload that referenced this issue Mar 29, 2024
@mtshv
Copy link

mtshv commented Jul 2, 2024

@sandeep14 please take a look at #347 (comment)

@erickalvesduobox
Copy link

erickalvesduobox commented Jul 16, 2024

Hi guys,

I'm also facing this problem in my project.
I've tried the proposed solution and while it worked in the android emulator, it didn't work on a xiaomi device with android 14.

Here is what I got from Sentry:

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

RemoteException: Remote stack trace:
	at com.android.server.am.ActivityManagerService.registerReceiverWithFeature(ActivityManagerService.java:14686)
	at android.app.IActivityManager$Stub.onTransact$registerReceiverWithFeature$(IActivityManager.java:12213)
	at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:3188)
	at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2859)
	at android.os.Binder.execTransactInternal(Binder.java:1346)

@mtshv
Copy link

mtshv commented Jul 22, 2024

Hi, @erickalvesduobox I followed the instructions, and the receiver error is gone for me. You can try using this patch file with patch package:

 # Reason for the 1st patch is to fix compatibility issue with Android 14
 # see https://github.com/Vydia/react-native-background-upload/issues/343
 # see https://github.com/Vydia/react-native-background-upload/pull/347

diff --git a/node_modules/react-native-background-upload/android/build.gradle b/node_modules/react-native-background-upload/android/build.gradle
index fa6963f..7a3c908 100755
--- a/node_modules/react-native-background-upload/android/build.gradle
+++ b/node_modules/react-native-background-upload/android/build.gradle
@@ -1,9 +1,9 @@
 buildscript {
     ext {
-        kotlinVersion = '1.6.0'
-        buildToolsVersion = '29.0.2'
-        compileSdkVersion = 29
-        targetSdkVersion = 29
+        kotlinVersion = '1.8.21'
+        buildToolsVersion = '34.0.8'
+        compileSdkVersion = 34
+        targetSdkVersion = 34
         minSdkVersion = 18
     }
     ext.detoxKotlinVersion = ext.kotlinVersion
@@ -20,7 +20,7 @@ buildscript {

 apply plugin: 'com.android.library'
 apply plugin: 'kotlin-android'
-apply plugin: 'kotlin-android-extensions'
+apply plugin: 'kotlin-parcelize'

 def DEFAULT_COMPILE_SDK_VERSION = 28
 def DEFAULT_BUILD_TOOLS_VERSION = "28.0.3"
@@ -64,7 +64,7 @@ dependencies {

     implementation "org.jetbrains.kotlin:$_kotlinStdlib:$_kotlinVersion"

-    implementation 'net.gotev:uploadservice-okhttp:4.7.0'
+    implementation 'net.gotev:uploadservice-okhttp:4.9.2'

     implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0'
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants