expo: Fatal Exception when `expo-av` used with `react-native-track-player`
Summary
I get a fatal exception when I call createAsync when expo-av used with react-native-track-player. It crashes without throwing an error so I only got the log on Android Studio logcat
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.appname, PID: 17129
java.lang.RuntimeException: Unable to stop service com.doublesymmetry.trackplayer.service.MusicService@c92725: kotlin.UninitializedPropertyAccessException: lateinit property player has not been initialized
at android.app.ActivityThread.handleStopService(ActivityThread.java:4375)
at android.app.ActivityThread.access$1900(ActivityThread.java:237)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1956)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: kotlin.UninitializedPropertyAccessException: lateinit property player has not been initialized
at com.doublesymmetry.trackplayer.service.MusicService.onDestroy(MusicService.kt:471)
at android.app.ActivityThread.handleStopService(ActivityThread.java:4355)
at android.app.ActivityThread.access$1900(ActivityThread.java:237)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1956)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
What platform(s) does this occur on?
Android
Environment
warn Package @sentry/react-native contains invalid configuration: "dependency.platforms.ios.sharedLibraries" is not allowed,"dependency.hooks" is not allowed. Please verify it's properly linked using "react-native config" command and contact the package maintainers about this.
info Fetching system and libraries information...
System:
OS: macOS 12.5
CPU: (6) x64 Intel(R) Core(TM) i5-8500B CPU @ 3.00GHz
Memory: 54.57 MB / 8.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.16.0 - /usr/local/bin/node
Yarn: 1.22.18 - ~/.yarn/bin/yarn
npm: 8.11.0 - /usr/local/bin/npm
Watchman: 2022.07.04.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK:
API Levels: 31, 33
Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.3, 31.0.0, 32.0.0, 32.1.0, 33.0.0
System Images: android-30 | Google Play Intel x86 Atom, android-31 | Intel x86 Atom_64, android-31 | Google APIs Intel x86 Atom_64
Android NDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8609683
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
Languages:
Java: 11.0.12 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: ^18.2.0 => 18.2.0
react-native: ^0.69.5 => 0.69.5
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Minimal reproducible example
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 18 (4 by maintainers)
@KrisLau oh that’s bad. i’m accepting this issue and plan to upgrade exoplayer. thanks for reporting this.
as expo sdk 47 is released, i’m closing this issue. thanks for everyone to report this.
@KrisLau I also had to use expo@47.0.0-alpha.1 in order to use expo-av properly in my tests.
But from my tests it has been working like a champ… so… thank you @Kudo !
Same exact problem here. Thank you for working on this issue @Kudo!
Is there an ETA on this ? no rush or stress, just trying to decide a few things based on its timing.
@fbotalla yeah basically but I’m not sure which version it is releasing in and when. you could also just use patch-package in the meantime. It’ll be released in v13 looks like:
@fbotalla hey just thought I’d let you know that it is just waiting to be merged so it should be done soon https://github.com/expo/expo/pull/19332
@Kudo No thank you for all the work you guys put in, I really appreciate it!
Is there a rough estimate for how long the upgrade will take? I’m just trying to decide if I should downgrade track player in the meantime haha but I’m not sure if their older version support react native > 0.69