acmerobotics / ftc-dashboard

React-based web dashboard designed for FTC
https://acmerobotics.github.io/ftc-dashboard
Other
178 stars 140 forks source link

Crashes on launch #14

Closed nch0w closed 4 years ago

nch0w commented 5 years ago

The app crashes when opened. I'm getting this error:

2019-11-08 18:01:55.970 3813-3813/com.qualcomm.ftcrobotcontroller E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.qualcomm.ftcrobotcontroller, PID: 3813
    java.lang.NullPointerException: Attempt to invoke interface method 'void com.qualcomm.robotcore.util.WebHandlerManager.register(java.lang.String, org.firstinspires.ftc.robotcore.internal.webserver.WebHandler)' on a null object reference
        at com.acmerobotics.dashboard.FtcDashboard.internalAttachWebServer(:517)
        at com.acmerobotics.dashboard.FtcDashboard.attachWebServer(:118)
        at org.firstinspires.ftc.robotcontroller.internal.FtcRobotControllerActivity.onServiceBind(:706)
        at org.firstinspires.ftc.robotcontroller.internal.FtcRobotControllerActivity$1.onServiceConnected(:193)
        at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1535)
        at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1563)
        at android.os.Handler.handleCallback(Handler.java:751)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:154)
        at android.app.ActivityThread.main(ActivityThread.java:6316)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)

Here is my FtcRobotControllerActivity.java file: https://gist.github.com/nchowder/e86a81e0ece858cf5b76ea5a3f767528

The line that throws the error is this:

FtcDashboard.attachWebServer(service.getWebServer());

It appears that service.getWebServer() is null. Could you help me troubleshoot this?

rbrott commented 5 years ago

Can you reproduce it?

rbrott commented 4 years ago

Also are you using OpenRC?

nch0w commented 4 years ago

Yes, I am, and I'm using a Moto G4. I will give you some steps to reproduce the issue soon.


From: Ryan Brott notifications@github.com Sent: Tuesday, November 12, 2019 9:13:39 AM To: acmerobotics/ftc-dashboard ftc-dashboard@noreply.github.com Cc: Neil Chowdhury neil.chowdhury@outlook.com; Author author@noreply.github.com Subject: Re: [acmerobotics/ftc-dashboard] Crashes on launch (#14)

Also are you using OpenRC?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/acmerobotics/ftc-dashboard/issues/14?email_source=notifications&email_token=AEDKDERVYAWTUYD5LW6KUJDQTK2ZHA5CNFSM4JLAJLJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOED2L4MY#issuecomment-552910387, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEDKDEQDVDMME3RSQ5W5WOLQTK2ZHANCNFSM4JLAJLJA.

NoahAndrews commented 4 years ago

@nchowder I suspect you are using the Extreme Turbo build variant of OpenRC. That version doesn't include the webserver, so it is incompatible with ftc-dashboard. Make sure to switch to the normal Turbo build variant in Android Studio.

NoahAndrews commented 4 years ago

@FROGbots-4634 You might want to consider mentioning that Extreme Turbo is incompatible with third-party libraries that use the webserver, such as ftc-dashboard.

rbrott commented 4 years ago

You can still use the dashboard with Extreme Turbo if you really want. Just omit the #attachWebServer() call and run the dashboard locally using the development instructions (or host the generated static files under releases).

nch0w commented 4 years ago

This solves my problem.