Running the command react-native run-android fails with the following output:
Starting JS server...
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
The curious thing about this problem is that an emulator is running. adb devices returns
List of devices attached
emulator-5554 device
If these details help, its running in Linux, with the emulator set as Android 6.0 API Level 23, using Google APIs Intel Atom (x86).
I had the same issue just last week. I tried building the project thru Android Studio. I think one of the reasons of this error is that, the build looks for the updated (or compatible) version of the Gradle. What I did was just let Android Studio be the one to update the gradle on the first build.
After that my app runs and builds without any issues.
Hope this helps.
Related
I have an Ionic Capacitor app running from VSCode, but am getting the following error when I try to launch the emulator directly from the IDE:
Multiple network interfaces detected! You must select an
external-facing IP for the dev server that your device or emulator can
access with the --public-host option.
I'm using the Ionic extension for VSCode to launch the Android emulator from VSCode, which ultimately is running the following command:
npx ionic build && npx ionic cap run android -l --external --target=Pixel_5_API_27
As shown that's a Pixel 5, using API 27. I've tried a couple of different emulators with different API versions but it behaves the same. I understand the error is indicating I need to provide a IP and port, but not sure exactly where to configure this, or if that's exactly what needs done.
This additional information is provided in the output, but also not sure where this would be configured, or as part of the command to run:
You must select an external-facing IP for the dev server that your
device or emulator can access with the --public-host option.
Note, this does work if I open my app from Android Studio and run it on the same emulator from within that IDE, so this is something specific to VSCode. Any idea on what I need to do to get this emulator to launch please?
I am trying to run react native in an emulator in my AMD based Pc. I get this error saying:
Execution failed for task ':app:installDebug'.
Failed to install on any devices.
I have shown this error in the below image:
I am following the official document.
In the official document, click the tab called "Building Projects with
Native Code". For Development OS : Windows and Target OS :
Android.
Note: Due to my AMD processor I have not installed Intel x86 Emulator Accelerator HAXM, see below image:
So as a work around for AMD processor I have followed this stackoverflow answer, to install ABI called arm64-v80 android 7.0 Nougat when creating a Virtual Device in Android studio. My virtual device is ready and also running now, see below image:
I can correctly start my emulator as shown below image:
MY Installed SDK platforms are:
My SDK tools are show below:
I don't know what is wrong? Please help???
It seems that your react-native run-android command is trying to run the app on an API 24 simulator and you started an API 25 one.
Check all the API 24 dependencies and start the API 24 emulator. It should work.
Here is a configuration that works in my case:
Additional notes:
From your pictures the emulator is not started yet. Check that simulator is really started yet.
Make sure you use Android Studio 3.1.4 and not 3.2.0 if you have RN 0.57.
Try to sync gradle and run the project from Android studio, it might work or give you more error info
Try to Add the API 24 deps and to start an API 25 simulator (From what I know AVD might require some deps from and older API level.
On pc, you should run x86 based emulator.
Try to restart your ADB server. You need to run 2 separate commands:
adb kill-server - to kill the ADB server.
and
adb start-server - to start the server again.
Hope it helps :)
I am new to Android Studio and I am facing this weird kind of behavior.
I have built a raw project in Android Studio and I have configured Andriod AVD.
Gradle builds successfully though. It shows waiting for the device to come online.
I am using a Mac.
You can run on real device to check what happen of you can down load genymotion and run your application on that virutal machine
Today I wanted to test how Meteor's android build worked. So I installed Meteor and created a test to-do app per their instructions. Then pr. instructions from here I installed the Java SDK, and confirmed I had the Android SDK from when I installed Visual Studio 2015.
Then came my first problem. When I tried to run meteor add-platform android from the command prompt. I got the error Cannot find module ‘is-property’, and quickly learned to fix this by cd'ing to the directory missing the module and running npm install is-property. A hat tip to this thread for the solution.
Okay, one more time: meteor add-platform android and this time with success. I then ran meteor run android, and sure enough, an emulator launched with my app. Or almost. Because the first message that greeted me was Application Error - The connection to the server was unsuccessful (http://localhost:12784) and the app crashed.
After searching around a bit, it seemed that because the emulator was so damn slow, the meteor script timed out and caused the crash. So I then tried installing Android Studio to use Android AVD manager. But now the emulator wouldn't even launch, and I got stock with the following:
Starting app on android emulator and then... nothing.
So I tried to uninstall all android sdks, android studio, and meteor.
Then I tried to
Installing meteor again.
Install only the Android SDK command line tools.
Added the Android SDK to my environment variables.
Ran the android.bat to make sure I installed almost all the newest tools and images plus the Intel x86 Emulator Accelerator (HAXM installer)
I Then tried running the meteor run android command again, only to get stuck at starting app on android emulator as seen in the first picture.
Let the Starting app on android emulator run for an hour plus to see if things were just slow.
I have also tried to follow advice from the following resources without help:
Android Emulator Hangs
Meteor with android having issue starting app on the device and emulator
Creating a new AVD- CPU/ABI field show 'No System images installed'
Unable to create Android Virtual Device
And btw, here is how my AVD config looks like
So what have I done wrong? Everything would not be a surprising answer. Jokes aside, what is it I need to do to get a proper running android emulator up for my meteor app on windows 10?
I was getting exactly the same thing, but I finally figured out the problem.
I tried running the emulator from the command-line:
emulator -avd Android_Emulator
This actually gave me a useful error message:
emulator: ERROR: x86 emulation currently requires hardware acceleration!
Please ensure Intel HAXM is properly installed and usable.
CPU acceleration status: HAXM is not installed on this machine
This StackOverflow thread helped figure out how to install this: Intel X86 emulator accelerator (HAXM installer) VT/NX not enabled
And then it worked! Really really slow! But it worked.
Try removing your Virtual Device and recreate it again, or try a different one. Next, rebuild your meteor app proyect.
Removing you virtual device
Android-Studio >> Configure >> AVD Manager >> Delete
In my case, no issues about Intel HXAM (already installed), but the virtual device was working time ago, suddenly, the "Starting app on android emulator" never ended. I think, its about cordova+npm related issues. So, try this.
In meteor proyect folder, try rebuild de app-cordova things using
Deleting .meteor/local/corova-build
Deleting .meteor/node_modules
Removing and adding android plaftorm with meteor remove-plarform android && meteor add-platform android
Running the commands meteor rebuild && meteor npm install
Ensure compatibility NodeJS libraries. In my case, meteor 1.8.2, nodejs 12.9.
I'm making a game for android with HaxeFlixel. I'm using VirtualBox to run Windows 7 on my Mac. After developing and building a game in FlashDevelop, I've navigated to the project folder in the command prompt and run this command:
lime test android
I get:
BUILD SUCCESSFUL:
error: device not found
error: device not found
-waiting for device
I made sure VirtualBox is recognizing my Android device in file explorer and in the devices tab in the context menu. I also ran lime setup and made sure I have all the Android development packages and the same version as my phone.
Any idea why my device isn't found?
Is there another way to deploy my HaxeFlixel project to my Android device?
Install Universal Android ADB Driver will solve the problem.