Skip to content

Android crash when turning off WiFi during upload (product flavor issue?) #251

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

Open
projuljustin opened this issue May 3, 2021 · 4 comments

Comments

@projuljustin
Copy link

projuljustin commented May 3, 2021

Hey there, I seem to be having an issue when turning off WiFi during an upload. The app crashes and I get this error:

2021-05-03 15:06:30.092 11885-11885/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.myapp.webview, PID: 11885
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:4180)
at android.app.ActivityThread.access$1600(ActivityThread.java:232)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:241)
at android.app.ActivityThread.main(ActivityThread.java:7617)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)
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(UploadServiceConfig.kt:74)
at net.gotev.uploadservice.UploadServiceConfig.getBroadcastNotificationAction(UploadServiceConfig.kt:234)
at net.gotev.uploadservice.UploadServiceConfig.getBroadcastNotificationActionIntentFilter(UploadServiceConfig.kt:248)
at net.gotev.uploadservice.observer.request.NotificationActionsObserver.register(NotificationActionsObserver.kt:31)
at net.gotev.uploadservice.UploadService.onCreate(UploadService.kt:194)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4168)
at android.app.ActivityThread.access$1600(ActivityThread.java:232) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 
at android.os.Handler.dispatchMessage(Handler.java:107) 
at android.os.Looper.loop(Looper.java:241) 
at android.app.ActivityThread.main(ActivityThread.java:7617) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941) 

I don't seem to get this issue when running my dev or tst app (com.myapp.webviewdev or com.myapp.webviewtest)

image

@lewisd1996
Copy link

@projuljustin Hi, did you ever find a solution to this?

@Jsxde
Copy link

Jsxde commented Apr 28, 2023

I have the same error, wondering too if anyone has a solution

@aidinb
Copy link

aidinb commented Oct 5, 2023

I have the same issue

@scremona-navico
Copy link

scremona-navico commented Feb 6, 2025

Add this to your build.gradle:
android {
// Conditional for compatibility with AGP <4.2.
if (project.android.hasProperty("namespace")) {
namespace "com.vydia.RNUploader"
} else {
// print
println "DEPRECATION WARNING: The namespace property is not available in your version of AGP. Please upgrade to AGP 4.2+."
}
...

then you'll probably need this fix too:
#343

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

5 participants