I have got my expo project and I ran 'expo eject' to run it in the react-native CLI. It works on the iOS with some adjusting (thanks to the guys on GitHub) however I can't seem to get my android to work. It's saying
'Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.'
I have tried building a new react-native app (without using expo) and it works no problem.
To me the ejected project is not linking to the environment somewhere. I have tried updating android studio, going through the environment setup and update gradle (that caused more issues haha)
Has anybody else come across this please?
I have worked out the solution around this. Run these next steps soon after you do 'expo eject' (As it suggests in the console after eject runs)
Next steps
โบ ๐ก You may want to run npx #react-native-community/cli doctor to help install any tools that your app may need to run your native projects.
โบ ๐ Download your Android keystore (if you're not sure if you need to, just run the command and see): expo fetch:android:keystoreNext steps
Related
I am new in RN, and frankly in any modern front-end tools. So, I am working on an existing project, where I just run
npx react-native start
to run the project from the terminal, when the packager has started, I run
npx react-native run-ios
on another terminal window, which pretty reluctantly starts the ios simulator and opens the app as well. but the problem occurs when I run
npx react-native run-android
on the same windows, it gives throws an error as given in the screenshot:
To solve the problem, I always open my Android Studio, and build and run the app, which runs the app in the android simulator.
But I would really appreciate if there are some JavaScript or RN geeks who can help me run the app in android by the command
npx react-native run-android
I run a mac, use VS Code, I have yarn, npm installed.
Just try to remove the virtual device from avd manager in android studio and recreate it again. I also faced this issue recently and this is how i solved it. Also, check for any available update in android studio build tools.
I've created a new React Native app with react-native init ProjectName and tried to run it within IntelliJ. For this I've created a new run configuration:
But after run this configuration, only react-native start is executed and not the actual start of the app (react-native run-android). Within a shell it's working, but not with IntelliJ and therefore debugging within IntelliJ is not readily possible.
I'm using the latest React Native version 0.50.1 and IntelliJ 2017.2.5.
Do you know such a problem and do you know how to fix it? For existing applications, it still worked, but not for new ones. After npm install it seems to be buggy also with existing projects.
Known issue, tracked as WEB-29569: the packager messages format has changed in react-native 0.50.*, and WebStorm can't parse the output and start the run command.
As a workaround, you can try downgrading react-native to 0.49.
everybody,
Yesterday I Installed everything necessary to develop and run an Android app with React Native on Windows: I updated my node.js, installed python2, react-native-cli, Android Studio with AndroidSDK with all tools and all necesary package details how it is described in React Native documentation. Also I set up Environment variables and path for ANDROID_HOME. Wneh I create a new emulator and run it I received this messages in Android studio:
"Unable to run 'adb': null"
and
"'C:\Users\User5\AppData\Local\Android\Sdk\platform-tools\adb.exe start-server' failed -- run manually if necessary"
When I create and run a new ReactNative app the building stucks on 97%. Attach imgs bellow.
When I create and run project on iOS there is no any problem.
I watched a lot of videos and tutorials and nothing seems wrong. But they all are with older version of Android Studio.
Does anybody know where could be the problem?
Thanks in advance.
My React Native very first Android Project stuck building on this stage:
I am trying to create a PhoneGap application using WebStorm 2016.3 IDE.
I am following this link link. I am able to create a project from the steps but while running the app I'm getting errors. While setting emulator I've found that Android SDK was not found.
I am unable to find how can I set that path here and the error I got is:
...and in log cat
"C:\Program Files (x86)\JetBrains\WebStorm 2016.3\bin\runnerw.exe" "C:\Users\Sa E\AppData\Roaming\npm\ionic.cmd" run --emulator android
รขลโ You cannot run iOS unless you are on Mac OSX.
I've tried some things by google but the data is for old IDE and I can't see such options with my current IDE.
I ran into the same issues on Windows. I added a system variable ANDROID_HOME with the address of the sdk folder. In my case it was
c:\Users\Andrew\AppData\Local\Android\sdk
After that, I restarted WebStorm, and it works fine.
PS make sure that you set up the project properly. Try creating a new project with type "PhoneGap/Cordova", then in the terminal type the following commands:
ionic start MyProjectName
ionic serve
If everything works at this point, then proceed:
ionic platform add android
ionic build android
ionic emulate android
You can use run instead of emulate if you have GenyMotion installed and running
I used #Andrew's answer, but did not manage to make it work. It appears i needed more Environment variables; so, after many searches, I found this link on Cordova documentation which helped me in making PHPstorm recognize the Android SDK. The question was about Webstorm, but the Cordova plugin requires the same environment variables.
Here's a quote from that site (if you do not know how to set environment variables, follow the above link to get help):
Cordova's CLI tools require some environment variables to be set in order to function correctly. The CLI will attempt to set these variables for you, but in certain cases you may need to set them manually. The following variables should be updated:
Set the JAVA_HOME environment variable to the location of your JDK installation
Set the ANDROID_HOME environment variable to the location of your Android SDK installation
It is also recommended that you add the Android SDK's tools, tools/bin, and platform-tools directories to your PATH
I faced the same problem with intellij idea ultimate on linux, while trying to run a cordova/phone gap project. Weirdly enough, the commands where running normally from the command prompt and the embedded terminal, however, trying to create a run configuration, I got the infamous errors.
I have the environment variables set correctly, but, I have them set in ~/.bashrc which intellijidea seems not t read.
I tried to add the variables manually in the same screenshot you included, with no success. The solution was to add ANDROID_HOME to the /etc/environment, rebooted, and everything worked as expected.
I am trying to build a Cordova project on Windows using the steps I was given by the team who developed it.
Install Bower, Cordova CLI, Grunt CLI, SASS/Compass/sass-globbing gems
grunt build
cordova platforms add android
Then trying to run grunt emulate android but getting an error. I have the Android SDK installed and can fire up an emulator but I'm getting the following when trying to run that command:
Warning: Task "android" not found. Use --force to continue.
What am I doing wrong? I'm new to Cordova/PhoneGap development and all this interplay between packages is daunting.
You probably should run
cordova run android or grunt emulate:android
First part with cordova CLI should run all the time, and no need to use Grunt to launch application, if all assets are prepared.
Grunt part is just a guess work based on how I would organize Gruntfile.js and I could be wrong here. Without seeing more details, hard to tell you more.