-
-
Notifications
You must be signed in to change notification settings - Fork 699
You have to set namespace to your app package name (context.packageName) in your Application subclass #510
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
Comments
this is how it's done in all my apps:
in your case the app context is returning a null package name. Compare also your code with this (check application subclass is registered in the manifest): https://github.com/gotev/android-upload-service/wiki/Getting-Started-with-4.x Passing |
Are you using code obfuscation, Proguard, R8, Minification? The problem is some setting in production mode. |
No I'm not using anything above. My project is simple Java based with androidx |
A little demo project will help to spot what the problem is |
You can create a simple Java based small demo and then make a release apk and run your app it will crash. If you still need me to share a demo share your thoughts immediately. I will make it within half an hour. |
@theshethmilan just updated the demo app of this project with a release config and it works: https://github.com/gotev/android-upload-service/tree/master/examples/app You can also try it and see if it works. If you make a minimal demo project we can compare the two. |
Ok sure. |
I have tried as you said but its keep crashing when release apk. Now getting another error "invalid channel for service notification startforeground" from this below line return new UploadNotificationConfig(App.CHANNEL, ringToneEnabled, progress, success, error, cancelled); in android 10 devices even though I already register I think you should allow developer to pass their own notification instead of creating of your own. |
@theshethmilan
You have full control if the default does not suit your needs: https://github.com/gotev/android-upload-service/wiki/Configuration#notification-handler |
Yes now after adding createNotificationChannel() in Application class it works fines. I have tested with Android 10 with release config. @gotev thanks and appreciate for your immediate help, action and support. |
You're welcome! Happy coding! 💪😎 |
Uh oh!
There was an error while loading. Please reload this page.
After writing this line in Application subclass oncreate a very first line
UploadServiceConfig.initialize(this, CHANNEL, BuildConfig.DEBUG);
Application gets keep crashing saying
You have to set namespace to your app package name (context.packageName) in your Application subclass
I am using implementation 'net.gotev:uploadservice:4.3.1'
My suggestion if you need a namespace to run this library then why you're not directly asking namespace instead of context in UploadServiceConfig.initialize(this.getPackageName(), CHANNEL, BuildConfig.DEBUG) something like this.
Please help me what I'm doing wrong. For your reference I am sharing exception stack trace for you:
net.gotev.uploadservice.UploadServiceConfig.getNamespace (UploadServiceConfig.kt:74)
net.gotev.uploadservice.UploadServiceConfig.getBroadcastStatusAction (UploadServiceConfig.kt:230)
net.gotev.uploadservice.UploadServiceConfig.getBroadcastStatusIntentFilter (UploadServiceConfig.kt:241)
net.gotev.uploadservice.observer.request.BaseRequestObserver.register (BaseRequestObserver.kt:36)
net.gotev.uploadservice.observer.request.RequestObserver.register (RequestObserver.kt:30)
net.gotev.uploadservice.observer.request.RequestObserver_LifecycleAdapter.callMethods (RequestObserver_LifecycleAdapter.java:25)
androidx.lifecycle.SingleGeneratedAdapterObserver.onStateChanged (SingleGeneratedAdapterObserver.java:31)
androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent (LifecycleRegistry.java:361)
androidx.lifecycle.LifecycleRegistry.forwardPass (LifecycleRegistry.java:300)
androidx.lifecycle.LifecycleRegistry.sync (LifecycleRegistry.java:339)
androidx.lifecycle.LifecycleRegistry.moveToState (LifecycleRegistry.java:145)
androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent (LifecycleRegistry.java:131)
androidx.lifecycle.ReportFragment.dispatch (ReportFragment.java:68)
androidx.lifecycle.ReportFragment.dispatch (ReportFragment.java:144)
androidx.lifecycle.ReportFragment.onResume (ReportFragment.java:116)
android.app.Fragment.performResume (Fragment.java:2568)
android.app.FragmentManagerImpl.moveToState (FragmentManager.java:1341)
android.app.FragmentManagerImpl.moveFragmentToExpectedState (FragmentManager.java:1576)
android.app.FragmentManagerImpl.moveToState (FragmentManager.java:1637)
android.app.FragmentManagerImpl.dispatchMoveToState (FragmentManager.java:3050)
android.app.FragmentManagerImpl.dispatchResume (FragmentManager.java:3012)
android.app.FragmentController.dispatchResume (FragmentController.java:205)
android.app.Activity.performResume (Activity.java:7652)
android.app.ActivityThread.performResumeActivity (ActivityThread.java:4054)
android.app.ActivityThread.handleResumeActivity (ActivityThread.java:4094)
android.app.servertransaction.ResumeActivityItem.execute (ResumeActivityItem.java:51)
android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:145)
android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:70)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1993)
android.os.Handler.dispatchMessage (Handler.java:106)
android.os.Looper.loop (Looper.java:216)
android.app.ActivityThread.main (ActivityThread.java:7266)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:494)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:975)
The text was updated successfully, but these errors were encountered: