THEOplayer / react-native-theoplayer

A React Native THEOplayerView component
https://theoplayer.github.io/react-native-theoplayer/
MIT License
62 stars 21 forks source link

Android error on build (Unresolved reference: setAllowBackgroundPlayback) #179

Closed davidwinograd1 closed 1 year ago

davidwinograd1 commented 1 year ago

When I build my project in Android Studio, I get the following error:

e: /Users/.../.../.../node_modules/react-native-theoplayer/android/src/main/java/com/theoplayer/ReactTHEOplayerContext.kt: (123, 25): Unresolved reference: setAllowBackgroundPlayback

Would anyone happen to know what is causing this, and what the fix is? I haven't changed my code and have never gotten this. Using version 2.11...

tvanlaerhoven commented 1 year ago

@davidwinograd1 setAllowBackgroundPlayback was added in Android SDK v5.7.0 (references: https://docs.theoplayer.com/changelog.md#android-570, https://docs.theoplayer.com/api-reference/android/com/theoplayer/android/api/THEOplayerSettings.html#setAllowBackgroundPlayback(boolean)). So if you have a pinned version in your apps gradle.properties file, make sure to at least target this version. By default the lates SDK version is used (currently 5.9.0).

But indeed: we should have update the minimal sdk version in react-native-theoplayer's build.gradle file. It's currently set to "[5.0.1,)" (5.0.1 or higher). We'll make a fix for that.

Thank you for reaching out!

tvanlaerhoven commented 1 year ago

@davidwinograd1 did this solve the issue for you?

tvanlaerhoven commented 1 year ago

Closing this ticket for now