You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
am running your app on an android studio emulator and it looks like this demo can't find it!
Whenever I run react-native run-android it gives error
Scanning 767 folders for symlinks in /home/user/Projects/Phones/react-native-track-player-demo/node_modules (7ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
My emulator is up and other projects can use it and install apps normally.
@maotora You may specify which emulator to run on like .. react-native run-android --deviceId emulator-5554
To get list of emulators run adb devices -l
Reacted by Daniel Dixon, Jett Robin Andres, Zhihang Zhang, Ahmad Karimpour, Ryan, MikuRoot, Franklin Ikenna Isaiah, Phil Andrews, Milad Asghari, Kelly Shen and 8 more
Reacted by MD Danish Ansari, Carlos Humberto Carreño Díaz as UPB Teacher, Alexandru Serban, Oscar Garcia, Toprak Koç, FAISAL ALSAEED, John, sneha-technodysis and Daniel
Hi @aivene25 ,
Thank you for your response but it still doesn't work.
I re-cloned the project, then ran yarn then react-native link then ran yarn again then npm run start and lastly react-native run android still same issue.
I tried your solution and it gave a different error.
⚠️long stacktrace ahead.
/home/user/Projects/demo/react-native-track-player/android/src/main/java/guichaguri/trackplayer/metadata/components/MediaNotification.java:4: error: cannot find symbol
import android.app.NotificationChannel;
^
symbol: class NotificationChannel
location: package android.app
/home/user/Projects/demo/react-native-track-player/android/src/main/java/guichaguri/trackplayer/metadata/components/MediaNotification.java:20: error: package android.support.v4.media.app.NotificationCompat does not exist
import android.support.v4.media.app.NotificationCompat.MediaStyle;
^
/home/user/Projects/demo/react-native-track-player/android/src/main/java/guichaguri/trackplayer/metadata/components/MediaNotification.java:42: error: cannot find symbol
private MediaStyle style;
^
symbol: class MediaStyle
location: class MediaNotification
/home/user/Projects/demo/react-native-track-player/android/src/main/java/guichaguri/trackplayer/metadata/components/MediaNotification.java:82: error: cannot find symbol
@RequiresApi(VERSION_CODES.O)
^
symbol: variable O
location: class VERSION_CODES
/home/user/Projects/demo/react-native-track-player/android/src/main/java/guichaguri/trackplayer/metadata/components/MediaNotification.java:56: error: cannot find symbol
if(VERSION.SDK_INT >= VERSION_CODES.O) createChannel();
^
symbol: variable O
location: class VERSION_CODES
/home/user/Projects/demo/react-native-track-player/android/src/main/java/guichaguri/trackplayer/metadata/components/MediaNotification.java:58: error: constructor Builder in class Builder cannot be applied to given types;
this.nb = new Builder(context, "trackplayer");
^
required: Context
found: Context,String
reason: actual and formal argument lists differ in length
/home/user/Projects/demo/react-native-track-player/android/src/main/java/guichaguri/trackplayer/metadata/components/MediaNotification.java:59: error: cannot find symbol
this.style = new MediaStyle().setMediaSession(session.getSessionToken());
^
symbol: class MediaStyle
location: class MediaNotification
/home/user/Projects/demo/react-native-track-player/android/src/main/java/guichaguri/trackplayer/metadata/components/MediaNotification.java:86: error: cannot find symbol
NotificationChannel channel = new NotificationChannel("trackplayer", "Media controls", NotificationManager.IMPORTANCE_LOW);
^
symbol: class NotificationChannel
location: class MediaNotification
/home/user/Projects/demo/react-native-track-player/android/src/main/java/guichaguri/trackplayer/metadata/components/MediaNotification.java:86: error: cannot find symbol
NotificationChannel channel = new NotificationChannel("trackplayer", "Media controls", NotificationManager.IMPORTANCE_LOW);
^
symbol: class NotificationChannel
location: class MediaNotification
/home/user/Projects/demo/react-native-track-player/android/src/main/java/guichaguri/trackplayer/metadata/components/MediaNotification.java:86: error: cannot find symbol
NotificationChannel channel = new NotificationChannel("trackplayer", "Media controls", NotificationManager.IMPORTANCE_LOW);
^
symbol: variable IMPORTANCE_LOW
location: class NotificationManager
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
10 errors
:react-native-track-player:compileReleaseJavaWithJavac FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-track-player:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 6.011 secs
Could not install the app on the device, read the error above for details.
I can see some light in this, do you have any solutions to this issue?
Scanning folders for symlinks in /home/user/Projects/demo/react-native-track-player/example/node_modules (7ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApk'.
> A problem occurred configuring project ':react-native-track-player'.
> Could not resolve all dependencies for configuration ':react-native-track-player:_debugPublishCopy'.
> Could not find com.android.support:support-annotations:26.1.0.
Searched in the following locations:
file:/home/user/Android/Sdk/extras/android/m2repository/com/android/support/support-annotations/26.1.0/support-annotations-26.1.0.pom
file:/home/user/Android/Sdk/extras/android/m2repository/com/android/support/support-annotations/26.1.0/support-annotations-26.1.0.jar
file:/home/user/Projects/demo/react-native-track-player/example/android/sdk-manager/com/android/support/support-annotations/26.1.0/support-annotations-26.1.0.jar
Required by:
example:react-native-track-player:unspecified > com.android.support:support-media-compat:26.1.0
example:react-native-track-player:unspecified > com.android.support:support-media-compat:26.1.0 > com.android.support:support-compat:26.1.0
> Could not find android.arch.lifecycle:runtime:1.0.0.
Searched in the following locations:
file:/home/user/Android/Sdk/extras/android/m2repository/android/arch/lifecycle/runtime/1.0.0/runtime-1.0.0.pom
file:/home/user/Android/Sdk/extras/android/m2repository/android/arch/lifecycle/runtime/1.0.0/runtime-1.0.0.jar
file:/home/user/Projects/demo/react-native-track-player/example/android/sdk-manager/android/arch/lifecycle/runtime/1.0.0/runtime-1.0.0.jar
Required by:
example:react-native-track-player:unspecified > com.android.support:support-media-compat:26.1.0 > com.android.support:support-compat:26.1.0
> Could not find com.android.support:support-annotations:26.1.0.
Searched in the following locations:
file:/home/user/Android/Sdk/extras/android/m2repository/com/android/support/support-annotations/26.1.0/support-annotations-26.1.0.pom
file:/home/user/Android/Sdk/extras/android/m2repository/com/android/support/support-annotations/26.1.0/support-annotations-26.1.0.jar
file:/home/user/Projects/demo/react-native-track-player/example/android/sdk-manager/com/android/support/support-annotations/26.1.0/support-annotations-26.1.0.jar
Required by:
example:react-native-track-player:unspecified > com.android.support:appcompat-v7:23.2.0 > com.android.support:support-v4:23.2.0
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 11.981 secs
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 959 file(s) to forward-jetify. Using 2 workers...
info Starting JS server...
info Launching emulator...
error Failed to launch emulator. Reason: No emulators found as an output of emulator -list-avds.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
every run my project always appear error like that
do you can handle my problem?
I found that specifically adding the emulator path (and in fact the platform-tools) folders to my PATH environment variable, those issues go away. Why it doesn't append to the ANDROID_SDK_ROOT environment variable in Windows I'm not sure.
Hi Guys, if anyone still has this issue. An easy fix is just to open the 'android' folder from your react-native project in android studio and build directly from there. None of the other solutions above worked for me. however this worked straight away.
Hi Guys, if anyone still has this issue. An easy fix is just to open the 'android' folder from your react-native project in android studio and build directly from there. None of the other solutions above worked for me. however this worked straight away.
where did you build? I dont have a build button when I go into Android studio -> Android folder.
Hi Guys, if anyone still has this issue. An easy fix is just to open the 'android' folder from your react-native project in android studio and build directly from there. None of the other solutions above worked for me. however this worked straight away.
where did you build? I dont have a build button when I go into Android studio -> Android folder.
Make sure you're opening the build.gradle file found in the /android directory in your react-native app folder when opening in Android Studio. Then you should be able to press the green 'play' button at the top of Android Studio. If this doesn't work make sure you've opened the emulator first and have it selected in the dropdown menu next to the 'play' button. Hope this helps :)
Flutter is able to detect open emulator, but react-native is not able to.
Facing same issue as others are facing it here.
What's the final call for resolution?
Activity
moonstruck commentedon Feb 4, 2018
@maotora You may specify which emulator to run on like ..
react-native run-android --deviceId emulator-5554To get list of emulators run
adb devices -lmaotora commentedon Feb 8, 2018
@moonstruck Hi.
Thanks for replying.
I tried your method unfortunately still fails.
enero-o commentedon Mar 27, 2018
The problem is not that it cant find the Android Emulator, There's an error in compiling your projects, have you linked your dependencies well ?
maotora commentedon Apr 4, 2018
Hi @aivene25 ,
Thank you for your response but it still doesn't work.
I re-cloned the project, then ran
yarnthenreact-native linkthen ranyarnagain thennpm run startand lastlyreact-native run androidstill same issue.ithustle commentedon Aug 23, 2018
@maotora , any thing?
himankpathak commentedon Aug 23, 2018
Facing the same issue, any fix yet?
jitish1 commentedon Oct 11, 2018
Hi, this might resolve the issue ---
maotora commentedon Oct 12, 2018
I didn't work, sadly.
moonstruck commentedon Oct 12, 2018
This repo is not active for last couple of months.
Try the new example Instead.
maotora commentedon Oct 15, 2018
Hello @moonstruck ,
I tried your solution and it gave a different error.
I can see some light in this, do you have any solutions to this issue?
jitish1 commentedon Oct 16, 2018
Hi @maotora
change your version in package.json
"react-native-track-player": "git+https://github.com/rm3rdmodules/react-native-track-player.git#dev",
maotora commentedon Oct 17, 2018
Now I feel stupid..
Changed the "react-native-track-player" to "git+https://github.com/rm3rdmodules/react-native-track-player.git#dev" and "version" to "0.0.2" in package.json.
Ran
npm install&react-native linkRan
react-native run-androidGets a different error.
Package.json file
{ "name": "example", "version": "0.0.2", "private": true, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "test": "jest" }, "dependencies": { "mobx": "^4.1.1", "mobx-react": "^5.0.0", "react": "^16.3.0-alpha.0", "react-native": "0.55.0", "react-native-track-player": "git+https://github.com/rm3rdmodules/react-native-track-player.git#dev", "react-navigation": "^1.5.9" }, "devDependencies": { "babel-jest": "22.4.3", "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-preset-react-native": "^4.0.0", "jest": "22.4.3", "react-test-renderer": "^16.3.0-alpha.0" }, "jest": { "preset": "react-native" } }moonstruck commentedon Oct 21, 2018
@maotora Give the dev branch a try.
maotora commentedon Oct 23, 2018
@moonstruck that's the only branch I have.
moonstruck commentedon Oct 23, 2018
@maotora Open emulator and try this
git clone https://github.com/react-native-kit/react-native-track-player.git
git checkout dev
cd example
yarn install
react-native run-android
devt3000 commentedon Apr 26, 2019
Hey, is the dev branch still working?
aristrisnawan commentedon Nov 12, 2019
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 959 file(s) to forward-jetify. Using 2 workers...
info Starting JS server...
info Launching emulator...
error Failed to launch emulator. Reason: No emulators found as an output of
emulator -list-avds.warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
every run my project always appear error like that
do you can handle my problem?
Samurai97 commentedon Nov 28, 2019
I found that specifically adding the emulator path (and in fact the platform-tools) folders to my PATH environment variable, those issues go away. Why it doesn't append to the ANDROID_SDK_ROOT environment variable in Windows I'm not sure.
RichardFisher8410 commentedon Apr 1, 2020
Hi Guys, if anyone still has this issue. An easy fix is just to open the 'android' folder from your react-native project in android studio and build directly from there. None of the other solutions above worked for me. however this worked straight away.
RanVaknin commentedon May 15, 2020
where did you build? I dont have a build button when I go into Android studio -> Android folder.
JoshuaMcEvoyPalo commentedon May 21, 2020
Make sure you're opening the
build.gradlefile found in the/androiddirectory in your react-native app folder when opening in Android Studio. Then you should be able to press the green 'play' button at the top of Android Studio. If this doesn't work make sure you've opened the emulator first and have it selected in the dropdown menu next to the 'play' button. Hope this helps :)vaibhavarora14 commentedon Nov 19, 2020
Flutter is able to detect open emulator, but react-native is not able to.
Facing same issue as others are facing it here.
What's the final call for resolution?