Skip to content

Android: NAMESPACE is null #117

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

Closed
vtjon opened this issue Mar 7, 2018 · 5 comments
Closed

Android: NAMESPACE is null #117

vtjon opened this issue Mar 7, 2018 · 5 comments

Comments

@vtjon
Copy link

vtjon commented Mar 7, 2018

The new version of uploadservice plugin requires you to set the namespace. Despite the namespace being declared on Line 8, it is null when you start the session. This causes the upload as well as the progress indicators to fail inexplicably. I tried setting the namespace in the session(id:string) method and it seems to work.

This may be more of a documentation issue but for any uploads to work now in Android Oreo, androidDisplayNotificationProgress must be set to true.

@radeva
Copy link
Contributor

radeva commented Mar 9, 2018

Hi @vtjon ,

Could you delete your platforms folder and try again? It's a know issue that when a native dependency is updated, you need to remove your platforms and run the app again.

@vtjon
Copy link
Author

vtjon commented Mar 26, 2018

I think you may be right. It seems to be working though I am testing again. I am going to close this and will reopen if necessary.

@vtjon vtjon closed this as completed Mar 26, 2018
@vtjon
Copy link
Author

vtjon commented Mar 26, 2018

This is still happening. I was confused because I wasn't testing on Android O device. When I tested, I got:

System.err: android.app.RemoteServiceException: Bad notification for startForeground: java.lang.RuntimeException: invalid channel for service notification: Notification(channel=null
pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x42 color=0x00000000 vis=PRIVATE)

This is because the plugin uses the namespace as the notification channel.

@vtjon vtjon reopened this Mar 26, 2018
@fthuin
Copy link
Contributor

fthuin commented Mar 31, 2018

ActivityManager: Error showing notification for service
ActivityManager: java.lang.RuntimeException: invalid channel for service notification: Notification(channel=null pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x42 color=0x00000000 vis=PRIVATE)
ActivityManager: 	at com.android.server.am.ServiceRecord$1.run(ServiceRecord.java:532)
ActivityManager: 	at android.os.Handler.handleCallback(Handler.java:790)
ActivityManager: 	at android.os.Handler.dispatchMessage(Handler.java:99)
ActivityManager: 	at android.os.Looper.loop(Looper.java:164)
ActivityManager: 	at android.os.HandlerThread.run(HandlerThread.java:65)
ActivityManager: 	at com.android.server.ServiceThread.run(ServiceThread.java:46)
System.err: android.app.RemoteServiceException: Bad notification for startForeground: java.lang.RuntimeException: invalid channel for service notification: Notification(channel=null pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x42 color=0x00000000 vis=PRIVATE)
System.err: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1768)
System.err: 	at android.os.Handler.dispatchMessage(Handler.java:106)
System.err: 	at android.os.Looper.loop(Looper.java:164)
System.err: 	at android.app.ActivityThread.main(ActivityThread.java:6494)
System.err: 	at java.lang.reflect.Method.invoke(Native Method)
System.err: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
System.err: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
ActivityManager: START u0 {flg=0x14008000 cmp=org.nativescript.tabacstopnativescript/com.tns.ErrorReportActivity (has extras)} from uid 10079
ActivityManager: Process org.nativescript.tabacstopnativescript (pid 4599) has died: fore TOP
ActivityManager: Scheduling restart of crashed service org.nativescript.tabacstopnativescript/net.gotev.uploadservice.UploadService in 1000ms
ActivityManager: Start proc 4709:org.nativescript.tabacstopnativescript/u0a79 for activity org.nativescript.tabacstopnativescript/com.tns.ErrorReportActivity
ActivityManager: Stopping service due to app idle: u0a79 -297ms org.nativescript.tabacstopnativescript/net.gotev.uploadservice.UploadService
ActivityManager: setHasOverlayUi called on unknown pid: 4599
ActivityManager: Displayed org.nativescript.tabacstopnativescript/com.tns.ErrorReportActivity: +804ms
ActivityManager: Killing 3898:com.google.android.videos/u0a74 (adj 906): empty #17
03-31 19:22:50.851  1592  1609 I chatty  : uid=1000(system) ActivityManager identical 1 line

@DimitarTodorov
Copy link
Contributor

The issue is fixed in version 3.2.3, which is now the latest official version in npm.

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

No branches or pull requests

6 participants