Skip to content
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

DroneKit 3.0.+ crashing on attemped connection to tower #482

Open
mittsq opened this issue Apr 7, 2018 · 2 comments
Open

DroneKit 3.0.+ crashing on attemped connection to tower #482

mittsq opened this issue Apr 7, 2018 · 2 comments

Comments

@mittsq
Copy link

mittsq commented Apr 7, 2018

I'm trying to implement a drone app on Android but am running into this frustrating error. Whenever I try to connect to a tower (that is, call tower.connect(this)) my app immediately crashes. When I comment this line, the app runs fine but, of course, won't connect to a drone.

Currently, I'm using Dronekit 3.0.+. Downgrading to 2.9.+ works. Is that my only option? It seems like 3DR is deprecated ...

Here is the error; I can always provide more if needed:

android.app.RemoteServiceException: Bad notification for startForeground: java.lang.RuntimeException: invalid channel for service notification: Notification(channel=null pri=-2 contentView=null vibrate=null sound=null defaults=0x0 flags=0x40 color=0x00000000 vis=PRIVATE)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1784)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6520)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:442)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
@chaviw
Copy link

chaviw commented Apr 15, 2018

Notification channels was added in Android O and crashes if not used correctly on apps targeting Android O. Dronekit has not be updated or tested on O. Try downgrading your target SDK in your Android app to < 26.

@sudarshanw
Copy link

I'm trying to implement a drone app on Android but am running into this frustrating error. Whenever I try to connect to a tower (that is, call tower.connect(this)) my app immediately crashes. When I comment this line, the app runs fine but, of course, won't connect to a drone.

Currently, I'm using Dronekit 3.0.+. Downgrading to 2.9.+ works. Is that my only option? It seems like 3DR is deprecated ...

Here is the error; I can always provide more if needed:

android.app.RemoteServiceException: Bad notification for startForeground: java.lang.RuntimeException: invalid channel for service notification: Notification(channel=null pri=-2 contentView=null vibrate=null sound=null defaults=0x0 flags=0x40 color=0x00000000 vis=PRIVATE)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1784)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6520)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:442)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Notification channels was added in Android O. If you resolve this error then you need to update updateForegroundNotification method inside org.droidplanner.services.android.impl.api.DroidPlannerService file.
updateForegroundNotification.txt

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

3 participants