react-native-background-upload
react-native-background-upload copied to clipboard
Crashing on android 11
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!!
I have the same error
I have the same error
Can anyone help us?
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
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)
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.]
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 ?
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