Closed fazzee closed 2 weeks ago
ur bug is this line: https://github.com/doublesymmetry/react-native-track-player/blob/9ff32f0f5a7b4f96900bf422810d587f5d2e3789/android/src/main/java/com/doublesymmetry/trackplayer/module/MusicModule.kt#L223
this number is in ms. DEFAULT_MIN_BUFFER_MS is 50000. u have to do some log printing urself to figure out the null pointer part.
thanks @lovegaoshi
Hi @lovegaoshi , Yeah I checked your suggestion. I'm using values in seconds as they are saying in their Docs.
await TrackPlayer.setupPlayer({ minBuffer: 60, playBuffer: 60, maxCacheSize: 32768, autoHandleInterruptions: true, iosCategory: IOSCategory.Playback, iosCategoryMode: IOSCategoryMode.VoiceChat, iosCategoryOptions: [IOSCategoryOptions.MixWithOthers], androidAudioContentType: AndroidAudioContentType.Music, })
But this way I'm getting the above error. Can you suggest some setupPlayer configs that used in both Android and iOS without having any errors?
buddy i neither get paid to maintain this lib, nor i actually uses a custom buffer range myself. i know the default works, which is setting both to 50000 ms. the rest its on you. do a couple of log.d
Describe the Bug I have this Error in Android and Unable to Initialise the Track Player:
The value for maxBuffer should be greater than or equal to minBuffer.
Then I added the maxBuffer and Got this Error, and My App is start Crashed:
ERROR Your app just crashed. See the error below. java.lang.NullPointerException com.doublesymmetry.trackplayer.service.MusicService.updateOptions(MusicService.kt:186) com.doublesymmetry.trackplayer.module.MusicModule$updateOptions$1.invokeSuspend(MusicModule.kt:260) kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108) android.os.Handler.handleCallback(Handler.java:938) android.os.Handler.dispatchMessage(Handler.java:99) android.os.Looper.loop(Looper.java:263) android.app.ActivityThread.main(ActivityThread.java:8292) java.lang.reflect.Method.invoke(Native Method) com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:612) com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1006)
Code To Reproduce `static async initialize() { if (Audio.isInitialized) return;
}`
Environment Info: Paste the results of `info Fetching system and libraries information... System: OS: macOS 14.6.1 CPU: (8) arm64 Apple M2 Memory: 134.00 MB / 8.00 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 18.19.0 path: ~/.nvm/versions/node/v18.19.0/bin/node Yarn: version: 1.22.22 path: ~/Documents/work/perzimo-health-app/perzimo-mobile/src/mobile/node_modules/.bin/yarn npm: version: 10.6.0 path: ~/.nvm/versions/node/v18.19.0/bin/npm Watchman: Not Found Managers: CocoaPods: version: 1.15.2 path: /Users/macbook/.rvm/gems/ruby-2.7.6/bin/pod SDKs: iOS SDK: Platforms:
info React Native v0.76.1 is now available (your project is running on v0.74.5). info Changelog: https://github.com/facebook/react-native/releases/tag/v0.76.1 info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.74.5 info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".`
Paste the exact
"react-native-track-player": "^4.1.1"
Real device? Yes, Oppo A5 2020 and Simulator also (Google Pixel 6) What OS are you running? MacBook Pro M2How I can Help What can you do to help resolve this?