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

android: App crashes on chrome.cast.requestSession #43

Closed
pgcan opened this issue Sep 12, 2019 · 5 comments · Fixed by #54
Closed

android: App crashes on chrome.cast.requestSession #43

pgcan opened this issue Sep 12, 2019 · 5 comments · Fixed by #54

Comments

@pgcan
Copy link
Contributor

pgcan commented Sep 12, 2019

I have two android devices and app crashes on method chrome.cast.requestSession call with below logs i found in logcat.

Device 1: OnePlus 7Pro, Android 9 - WORKS FINE
Device 2: OnePlus Two, Android 6.0.1 - CRASH

 --------- beginning of crash
09-12 13:24:28.581 14046-14046/no.myapp E/AndroidRuntime: FATAL EXCEPTION: main
    Process: no.myapp, PID: 14046
    java.lang.NoClassDefFoundError: acidhax.cordova.chromecast.-$$Lambda$r-7qqWexZCMew-ZX5x2dUMjX1R0
        at acidhax.cordova.chromecast.Chromecast$2.run(Chromecast.java:209)
        at android.os.Handler.handleCallback(Handler.java:739)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:152)
        at android.app.ActivityThread.main(ActivityThread.java:5497)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
09-12 13:24:28.587 14046-14046/no.myapp D/AppTracker: App Event: crash
@pgcan
Copy link
Contributor Author

pgcan commented Sep 12, 2019

The issue is on line 209 Chromecast.java.
routeList.sort(Comparator.comparing(RouteInfo::getName));

routeList which is of Type ArrayList does not support "sort" and "comparing" function in API below 24 on android.

@anthonylavado
Copy link
Member

anthonylavado commented Sep 12, 2019

Ah perfect. I had reported this in #42, but I’m one of the the admins for Jellyfin, not so much a code person.

Thanks for looking in to this!

@anthonylavado
Copy link
Member

Okay, merged the two PRs to try and get these fixes moving. Still would benefit from a null check as @thornbill mentions here: #45 (review)

@Lindsay-Needs-Sleep
Copy link
Collaborator

Lindsay-Needs-Sleep commented Sep 15, 2019

(This is non-issue in 1.0.0 as this is no longer used. 1.0.0 is almost ready on the Android side, but I have feeling a decent amount of work on iOS will be needed... I know it doesn't directly help, but I thought I should mention it.)

@Lindsay-Needs-Sleep Lindsay-Needs-Sleep mentioned this issue Sep 15, 2019
3 tasks
@lewazo
Copy link
Contributor

lewazo commented Sep 15, 2019

That's odd, it didn't occur to me this method wouldn't exist on an older API version, since ArrayList.sort has always existed in Java.

I never knew there were differences in Android API and Java API. I thought Android implemented verbatim the standard Java packages like Java.Util in which ArrayList is from. That's definitely something I'll watch for now!

Good to know and sorry for my mistake!

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

Successfully merging a pull request may close this issue.

4 participants