-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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 failing due to TypeError: Cannot read property 'CAPABILITY_PLAY' of null
#2368
Comments
Well.. interesting.. After fighting with this for 24 hours, I did various things. I'll list out what I did to get this to work on Android (Note: I don't know which one of these things actually worked but here's what I tried, in this order). First attempt:
Second attempt:
Third attempt: This didn't work, so I needed to run I also tried Fourth attempt: 🎉 Fifth attempt (this worked for me): 🎉
I am not certain why this worked when other development builds failed, but this did the trick for me. Noteworthy debuggingComment out all TrackPlayer imports Install expo-av Add space via Android Studio
Open Android Studio -> Virtual Device Manager -> Edit your testing device (click the pencil icon) -> Show Advanced Settings -> Add Internal Storage (I went from 6gb to 12gb) Update all the android Studio things Package versions I'm using {
"name": "app-name-here",
"version": "1.0.0",
"scripts": {
...
},
"dependencies": {
"expo": "~50.0.20",
"expo-av": "~13.10.6",
"expo-dev-client": "~3.3.12",
"react": "18.2.0",
"react-native": "0.73.6",
"react-native-track-player": "^4.1.1",
},
"private": true
} Should anything else come up, I will continue to add to this comment. If this helped, leave an emoji reaction to help other fellow developers use this awesome package! 🎉 |
expo managed is inherently not dev friendly to any RN libraries that modifies native code. and I dont recommend anyone seriously looking into app development to completely avoid native code and use expo managed. RNTP has heavily edited native code and will most likely not work with expo managed at all. RNTP's expo compatibility comes with expo's inherent compatibility with ANY RN project. you should follow https://docs.expo.dev/bare/installing-expo-modules/ instead. my app uses expo in the exact same manner. |
I too am experiencing this, but I'm not using expo--using a proprietary react-native framework, so unable to provide a repro. Is there a clue to what this error actually means? Personally, I traced it to the use of the |
I started using this package last night and LOVE it! It works flawlessly on iOS. Unfortunately it doesn't seem to do what it's supposed to in the Android Emulator.
Describe the Bug
Having
import TrackPlayer from 'react-native-track-player';
anywhere in a React Native / Expo project causes the error. The error from the terminal is this:Steps To Reproduce
npm install react-native-sound --save
import TrackPlayer from 'react-native-track-player';
anywhere into your codebasenpx expo start
and select AndroidCode To Reproduce
N/A
Environment Info:
Paste the results of
npx react-native info
:Paste the exact
react-native-track-player
version you are using:"react-native-track-player": "^4.1.0",
Real device? Or simulator? Android Emulator
The text was updated successfully, but these errors were encountered: