react-native-track-player
react-native-track-player copied to clipboard
Error running basic expo
Describe the Bug When starting a basic expo app
TypeError: null is not an object (evaluating 'TrackPlayer.RATING_HEART')
Steps To Reproduce
start expo on android
Code To Reproduce Please provide a simple code example that allows others to replicate the bug.
import TrackPlayer from 'react-native-track-player';
const start = async () => {
// Set up the player
await TrackPlayer.setupPlayer();
// Add a track to the queue
await TrackPlayer.add({
id: 'trackId',
url: 'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3',
title: 'Track Title',
artist: 'Track Artist',
artwork: '',
});
// Start playing it
await TrackPlayer.play();
};
start();
Environment Info:
Paste the results of npx react-native info
❯ npx react-native info
warn Package expo-modules-core has been ignored because it contains invalid configuration. Reason: "dependency.platforms.ios" must be of type object
info Fetching system and libraries information...
System:
OS: Linux 5.15 undefined
CPU: (16) x64 11th Gen Intel(R) Core(TM) i9-11900H @ 2.50GHz
Memory: 1.46 GB / 15.31 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.14.0 - /usr/local/bin/node
Yarn: 1.22.18 - /usr/bin/yarn
npm: 8.3.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/bin/watchman
SDKs:
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Languages:
Java: 17.0.3 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: * => 17.0.2
react-native: * => 0.67.3
npmGlobalPackages:
*react-native*: Not Found
Paste the exact react-native-track-player
version you are using
"react-native-track-player": "^2.1.2",
Real device? Or simulator?
Real device
What OS are you running?
Android
"expo": "^44.0.6",
How I can Help I looked up and found this issue
But the answer does not help in this case because im just importing the player.
That is my problem too, I already Spent two days and still get the same error!
@adelin-b @Taha-khojasteh ,
Please see if this is still an issue in v2.2.0-rc3 as it's a complete android rewrite. If its still an issue there can you let us know?
Thanks!
@adelin-b @Taha-khojasteh ,
Please see if this is still an issue in v2.2.0-rc3 as it's a complete android rewrite. If its still an issue there can you let us know?
Thanks!
@jspizziri
Unfortunately I still get same Error (with v2.2.0-rc3 version)
Getting same error with expo sdk 44 on android with v2.2.0-rc3 version
I am getting the same error. When researching I found an old issue which solved this problem with manually editing the linking.
I am getting the same error. When researching I found an old issue which solved this problem with manually editing the linking.
Is there any fix rather than ejecting expo?
Expo support in the managed workflow is not up to us. They only make available a limited number of third party dependencies in their default runtime.
If you want to use this library you have to use a mode of expo that allows you to add your own libraries that have native code (bare workflow).
I have the exact same problem, without using Expo.. Is there a solution for this?
I have the exact same problem, without using Expo.. Is there a solution for this?
@sjorsroelofs this issue is dedicated to expo. Please open a unique ticket providing additional information for your issue. Thanks!
It sounds like this issue is the result of not using expo bare. If someone is specifically using expo bare and having this issue let me know and I'll reopen.
It sounds like this issue is the result of not using expo bare. If someone is specifically using expo bare and having this issue let me know and I'll reopen.
@jspizziri Dear as I mentioned before I've had this problem with bare Expo project from clear Canvas, currently I'm working on project and I'm willing to use your library please work on this issue, Thanks
@Taha-khojasteh thanks for letting us know it's in bare.
This is something we'll add to the backlog. In terms of its priority for the core team, it will probably fall after the 2.2.0 release. If you'd like to take a crack at solving the issue it would come sooner. Let me know!
@jspizziri I'm willing to solve this issue, if there is any information, Let me know.
@Taha-khojasteh that would be great! I don't know anything about the issue other that what has been discussed on this issue so far.
i have the same problem, How to solve this problem?
Any solution ? I'm working with expo dev-cient and I can't use react-native track player
I'm going to close this until someone from the community is willing to contribute code for Expo.