Hi all.
I’m facing a problem when I’m trying create android builds.
When I run the command: ionic run android I get the following error:
Running command: “C:\Program Files\nodejs\node.exe” C:\Users\Felipe\Desktop\projects\scgasapp\hooks\after_prepare\010_add_platform_class.js C:\Users\Felipe\Desktop\projects\scgasapp
add to body class: platform-android
ANDROID_HOME=C:\Users\Felipe\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_65
The system cannot find the path specified.
Error: cmd: Command failed with exit code 1
My system information:
Cordova CLI: 7.0.1
Ionic CLI Version: 2.1.8
Ionic App Lib Version: 2.1.4
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.10.3
Xcode version: Not installed
My ANDROID_HOME and JAVA_HOME are valid.
Anyone can help me with this problem?
Thanks!
Generally error messages that sound like this are preceded immediately by whatever “the path specified” was, which is pretty vital information.
Hi, thanks for your reply.
- Is your android device connect via USB to your windows device? Yes
- Is it recognized with drivers? (check connected devices on chrome inspector tools for example) Yes
I got everything updated… Really don’t know what is happening.
@felipesabino I think because now Windows doesn’t know where is java core located, and same for Ionic.
I explain.
Go to my computer > properties > environment variables. On my old Win 7 this look like that, with a button for environment variables.
There is the same in Win10, just not at the same place. I know this Android JDK place changed when I updated Android, but it doesn’t update it in Windows core/start values. Try to change them and reboot windows so they both match And if all goes well, your “android run” should work again.
Hope it helps =)
Problem solved.
Uninstall Ionic
Unistall Android Studio(And SDK)
Reinstall last ionic version
Reinstall last Android Studio version
Delete the project platform and node_modules folders
Run the command ionic cordova run android (My ionic version is 3)
CLI will ask to install some versions of ionic, I just choosed yes
After that I runned in the android device with success
Thanks for the messages!