I am trying to install an app with react native cli but get the
ERROR: JAVA_HOME is not set and no 'java' command could be found in
your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation. 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
error...
And frankly this is sooo ofrustrating... Never had an issue with ionic or cordova nor android studio but infortunally, I need some native functions for my app...
Here is a background, at first the app was installing, I even was able to run hot reload on it then out of nowhere, without any change on the computer, I get this message whenever I try :react-native run-android".... I followed exactly what's on facebook github page but got this error... So i tried running a simple app on android studio and it worked...
Can someone have solution and also why this is happening out of nowhere?
Oh, I forgot right before I got this error, for some reason, I had to reinstall npm because nodeJs was not recognizing the npm command anymore
Ps : I even uninstall then reinstall android studio, uninstalled react-native-cli and reinstalling it, uninstalled react-native-create-project, reinstalled npm.
Check like this maybe this is the issue I guess:
1.Open the App that u have created using create-react-native-app or react-native init appName in android studio
It will be something like: appName>android>local properties(SDK location)
2.If u use windows pc/laptop then go to my computer right click for properties>advanced system settings click on that and find the environmental variables
and check if they are matching
Well, I got tired of it since none of the solutions on the web worked, I just wiped out my computer, reinstalled windows, got rid of all the non needed programs, reinstalled android SDK, java, react and... Still got this error... So I set JAVA_HOME (thanks youtube) and now it is working.
Related
Facing issue " Failed to install the app. Make sure you have the Android development environment " in react native
I have facing an android development error who should I resolve it . I used npx react-native init project name and then I ran react-native run-android I have always seen an error of android development server
It's a common pitfall for beginner. The error
Failed to install the app. Make sure you have the Android development environment ...
is misleading.
The real error is in the line
What went wrong: The suppplied javaHome seems to be invalid
which suggest that you should check the value of your env variable JAVA_HOME and make sure it points to a valid Java installation directory.
And if you have checked it and cannot figure out the problem, you may find it useful to check this question (IntelliJ Gradle Plugin: The supplied javaHome seems to be invalid) out. For example, someone suggest that its possible root cause is the incompatible version (32/64 bit) of your JDK.
I am currently pretty lost where to start searching for the error that I am facing. The same AngularJS project that my colleagues have been working on for quite a while on Macs cannot be compiled correctly on my Windows machine. No idea if windows and mac has anything to do with the error but just in case I am adding this information.
I've checked out the project with SourceTree and opend it with WebStorm.
First npm install then gulp dev in the terminal of WebStorm and my angularJs-project is beeing compiled without any errors. When then the browser windows with //localhost is beeing opened, the page shows shortly the loading anymation and then stays blank.
In the attached screenshot you can see the output of the console. Any ideas?
AngularJS Version: 1.7.2
NPM Version: 5.6.0
Gulp:
CLI version 3.9.1
Local version 3.9.1
What could make the difference that the project is running perfectly on other machines but not on mine?
[Edit]:
I have now reanimated my old macbook, checked out the exact same project with source tree, installed webstorm, ran npm install, then doing this to set up gulp and then running gulp dev: The App runs just fine.
On my Windows Laptop I've started all over, deinstalled WebStorm, deinstalled node.js and did the whole set up as described above. Only difference that I need to install node.js manually on Windows to use npm.... same error as described before.
I'm currently trying to learn react native. I created a project using create-react-native-app. After the project is created, I started npm start on the folder which shows the QR code. I've installed the expo app on my android phone and scanned the code but I'm getting a Uncaught Error: Timed out, no manifest in cache on my expo app and there is no stack trace given.
I've made it work a while ago but somehow its currently not working.
Im using windows 10.
npm 5.6
yarn 1.5.1
What I've done to fix it using Ubuntu was (I created my app using create-react-native-app):
open terminal
execute ifconfig
find network interface (wlp4s0, in my case)
execute export REACT_NATIVE_PACKAGER_HOSTNAME="IP_FOUND_BEFORE"
yarn start
SUCCESS! Finished building JavaScript bundle in 10069ms
Expo only supports the most recent 6 versions, this is because we have to have all the native code for each version on the client and that gets big fast ππ£. As of writing this v26 is almost out, that version of the expo client will not support v19 projects. Please make sure that your app is up-to-date by going to the app.json (or exp.json depending on how old your project is π
) and checking the version number.
Outside of that, I would also recommend you start your project by calling exp start in the root folder of your project π
The problem that causes this is having multiple network connections. In my case, I have a virtual network connection which is used by the packager instead of the wifi connection. So basically what's happening is that my phone and my computer uses different connections. I've found a solution here: https://github.com/react-community/create-react-native-app/issues/598
I am connected to the same network my device and PC , how can we fix this error ,
After restarting it gives the same error with :
Switched to a LAN URL because the tunnel appears to be down. Only devices in the same network can access the app. You can restart the project to try reconnecting.
on my device it says
Tunnel packager ....exp.not found
I am running on windows btw;
Thanks
Expo and react-devtools do not go together. So if you are using react-devtools, you must uninstall it. This worked for me:
npm uninstall react-devtools -g
But I noticed some other people were successful with this here.
npm uninstall react-devtools --save-dev
This is mostly because your firewall is blocking it. Verify by shutting off the firewall
Try running the ngork.exe in the background.
You can download ngork at ngork
Tunnel uses ngork. I faced similar issue and running ngork at background solved me the issue.
Am not sure how it fixed the 'Error starting tunnel' issue.
Hope I fill find it soon.
I solved this by examining my order of operations.
Other people at my workplace had managed to set the project up but for some reason I ran into this error.
I was using VSCode debugger and figured out that the emulator needed expo to be open and the project to be open within expo on the simulator before tunnelling was successful. I was attempting to run the debugger without actually opening the app.
this usually happens when you have an inconsistent internet connection. you can try restarting your wifi/computer & restarting xde. if that doesnβt work, you can try using a different network to connect to the internet. a last resort is connecting your device to the LAN and strong text running from there
In my case, somehow expo was unable to install #expo/ngrok library (that it uses internally to create a tunnel) when I click on tunnel option.
You can solve the issue by installing the library globally using npm and restarting the expo metro bundler with expo start.
npm install --global #expo/ngrok
This can also happen if you are using a VPN. Turning it off my VPN worked for me.
I made some fixes for my App and wanted to try it out today on my iPhone and now I can't install it on the device anymore. I'm getting the error "Unable to Download App" on the phone.
I haven't changed anything on my Apple Developer Account and yesterday everything was working fine. Is this a known bug and does anybody know how to fix this? My iPhone is of course registered and I also did the "iOS Certificate Wizard" and built it again but it didn't work either.
Edit: So I was able to install the app after doing the complete Certificate Wizard again with also overwriting everything (which I had not done before), but now I made another build and I can't install it again! Do I really have to do the Wizard thing every time I send a build now?
Are you trying to install a distribution build on top of a development build, or vice-versa? If so, uninstall the existing app first.