react-native-background-upload icon indicating copy to clipboard operation
react-native-background-upload copied to clipboard

Crashing on android 11

Open siddharth-kt opened this issue 3 years ago • 9 comments

App is crashing on android 11 only and i got this report:

Fatal Exception: java.lang.RuntimeException: Unable to create service net.gotev.uploadservice.UploadService: java.lang.IllegalArgumentException: You have to set namespace to your app package name (context.packageName) in your Application subclass

Caused by java.lang.IllegalArgumentException: You have to set namespace to your app package name (context.packageName) in your Application subclass at net.gotev.uploadservice.UploadServiceConfig.getNamespace ...

Kindly tell me the solution!!

siddharth-kt avatar Sep 23 '21 17:09 siddharth-kt

I have the same error

sergeymild avatar Oct 06 '21 12:10 sergeymild

Screen Shot 2021-10-16 at 6 23 45 PM I have the same error Can anyone help us?

quangphungntq avatar Oct 16 '21 11:10 quangphungntq

Edit

node_modules/react-native-background-upload/android/build.gradle b/node_modules/react-native-background-upload/android/build.gradle

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

Then apply the patch via npx patch-package react-native-background-upload

More info at https://github.com/ds300/patch-package#readme

swizes avatar Nov 24 '21 11:11 swizes

I can confirm the same error exists for me on Android 10 V2027 device.

Following is the trace: Fatal Exception: java.lang.RuntimeException: Unable to create service net.gotev.uploadservice.UploadService: java.lang.IllegalArgumentException: You have to set namespace to your app package name (context.packageName) in your Application subclass at android.app.ActivityThread.handleCreateService(ActivityThread.java:4292) at android.app.ActivityThread.access$1800(ActivityThread.java:259) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2126) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:230) at android.app.ActivityThread.main(ActivityThread.java:7880) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:526) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1034)

rahul2992 avatar Sep 20 '22 13:09 rahul2992

Error is still happening to me Version 6.6.0 RN Version 0.66.4

Tried to add packages.add(new UploaderReactPackage());

on MainApplication.java getPackages() as it says in the README but Then I get another error: [java.lang.IllegalStateException: Native module RNC_AsyncSQLiteDBStorage tried to override AsyncStorageModule. Check the getPackages() method in MainApplication.java, it might be that module is being created twice. If this was your intention, set canOverrideExistingModule=true. This error may also be present if the package is present only once in getPackages() but is also automatically added later during build time by autolinking. Try removing the existing entry and rebuild.]

hackaprende avatar Mar 08 '23 16:03 hackaprende

Error is still happening to me Version 6.6.0 RN Version 0.66.4

Tried to add packages.add(new UploaderReactPackage());

on MainApplication.java getPackages() as it says in the README but Then I get another error: [java.lang.IllegalStateException: Native module RNC_AsyncSQLiteDBStorage tried to override AsyncStorageModule. Check the getPackages() method in MainApplication.java, it might be that module is being created twice. If this was your intention, set canOverrideExistingModule=true. This error may also be present if the package is present only once in getPackages() but is also automatically added later during build time by autolinking. Try removing the existing entry and rebuild.]

Hi, Have you got any solution for this ?

Hassaan68 avatar Apr 24 '23 14:04 Hassaan68

Error is still happening to me Version 6.6.0 RN Version 0.66.4

Tried to add packages.add(new UploaderReactPackage());

on MainApplication.java getPackages() as it says in the README but Then I get another error: [java.lang.IllegalStateException: Native module RNC_AsyncSQLiteDBStorage tried to override AsyncStorageModule. Check the getPackages() method in MainApplication.java, it might be that module is being created twice. If this was your intention, set canOverrideExistingModule=true. This error may also be present if the package is present only once in getPackages() but is also automatically added later during build time by autolinking. Try removing the existing entry and rebuild.]

This is another issue, you have to delete packages.add(new UploaderReactPackage()); since now libraries are autolinked. We should update the README

r0xsh avatar May 11 '23 13:05 r0xsh