react-native-track-player icon indicating copy to clipboard operation
react-native-track-player copied to clipboard

Error running basic expo

Open adelin-b opened this issue 2 years ago • 16 comments

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.

adelin-b avatar Mar 26 '22 21:03 adelin-b

That is my problem too, I already Spent two days and still get the same error!

Taha-khojasteh avatar Apr 06 '22 08:04 Taha-khojasteh

@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 avatar Apr 14 '22 14:04 jspizziri

@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)

Taha-khojasteh avatar Apr 15 '22 05:04 Taha-khojasteh

Getting same error with expo sdk 44 on android with v2.2.0-rc3 version

ahmedsamirdev avatar Apr 22 '22 00:04 ahmedsamirdev

I am getting the same error. When researching I found an old issue which solved this problem with manually editing the linking.

JanKhstll avatar Apr 24 '22 08:04 JanKhstll

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?

ahmedsamirdev avatar Apr 24 '22 13:04 ahmedsamirdev

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).

dcvz avatar Apr 24 '22 13:04 dcvz

I have the exact same problem, without using Expo.. Is there a solution for this?

sjorsroelofs avatar Apr 25 '22 11:04 sjorsroelofs

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!

jspizziri avatar Apr 25 '22 12:04 jspizziri

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 avatar Apr 27 '22 12:04 jspizziri

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 avatar Apr 28 '22 14:04 Taha-khojasteh

@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 avatar Apr 28 '22 14:04 jspizziri

@jspizziri I'm willing to solve this issue, if there is any information, Let me know.

Taha-khojasteh avatar May 14 '22 04:05 Taha-khojasteh

@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.

jspizziri avatar May 14 '22 10:05 jspizziri

i have the same problem, How to solve this problem?

13627491210 avatar Jun 12 '22 08:06 13627491210

Any solution ? I'm working with expo dev-cient and I can't use react-native track player

lordkyle0 avatar Jul 27 '22 00:07 lordkyle0

I'm going to close this until someone from the community is willing to contribute code for Expo.

jspizziri avatar Aug 30 '22 18:08 jspizziri