Can someone please help me troubleshoot my ionic 3 project…something went wrong with my environment and now i cant build my ionic 3 project i get this error
ANDROID_HOME=E:\Java\Android\installation\Android\Sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_131
Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: E:\Java\Android\installation\Android\Sdk\tools\templates\gradle\wrapper
i have trying updating my SDK multiple time but no luck…
i have removed my android platform but every time i add it back i get an error…
when i run this command “ionic cordova platform list” i get this.
Hello, looks like your primary issue is about Java on Windows, try to reinstall it from java.com.
Then, you should be able to run the command again (and make sure Windows PATH variables are ok).
when I try to install android platform i have always the same issue.
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms\android
Package: io.ionic.ternatsterker
Name: ternatsterker
Activity: MainActivity
Android target: android-26
Subproject Path: CordovaLib
Android project created with cordova-android@6.4.0
Installing "cordova-plugin-camera" for android
Failed to install 'cordova-plugin-camera':Error: cmd: Command failed with exit code ENOENT
at ChildProcess.whenDone (C:\Users\fred\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
at emitOne (events.js:116:13)
at ChildProcess.emit (events.js:211:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:196:12)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
Error: cmd: Command failed with exit code ENOENT
my project work properly on local or via ionic view, but can’t add a platform.
It seems like there is a file or directory missing. I don’t know if the newest version of ionic supports cordova 6.5. Your npm is very old, too.
I recommend the following steps:
Run npm list -g --depth=0
and write down the list of globally installed modules.
Run npm uninstall -g MODULE1 MODULE2 MODULE3 ...
to remove all modules, that were listed through the previous command except for the npm module itself.
Run npm i -g npm
to upgrade your npm to the latest version.
Install all previously uninstalled modules with npm i -g MODULE1 MODULE2 MODULE3 ...
Delete the node_modules directory of your ionic project and also the package-lock.json file. Navigate with your command line to that project folder and run npm i
to reinstall all dependencies for your project.
Check if your android platform was correctly removed by running ionic cordova platform rm android
and check if there is no android folder in your projects platform folder. Run ionic cordova platform add android
to add the android platform to your project.