Hello,
currently I’m trying to build a sample project for android.
When I run the following command
ionic cordova build --release android
I get the following error:
Running command - failed!
[ERROR] An error occurred while running cordova platform add --save android (exit code 1):Running command: /home/marcel/hooks/before_platform_add/init_directories.js /home/marcel Using cordova-fetch for cordova-android@^6.2.3 Error: Platform android already added.
I tried to google my error message and searched here a bit, but I couldn’t find a thread that is related to my error. I also hope this is in the right category.
My current envoirment is the Ubuntu container inside windows.
I followed this instructions IonWordpress Documentation v2 - Google Docs for setting up
Would be really nice if someone could help me with that ![]()
Edit: After removing android as a platform with
cordova platform rm android
and rerunning the build command
I get this error:
[ERROR] An error occurred while running cordova platform add --save android (exit code 1):
Running command: /home/marcel/hooks/before_platform_add/init_directories.js /home/marcel Using cordova-fetch for cordova-android@~6.2.2 Adding android project... Creating Cordova project for the Android platform: Path: platforms/android Package: com.startapplabs.ionWordpress Name: ionWordpress Activity: MainActivity Android target: android-25 Subproject Path: CordovaLib Android project created with cordova-android@6.2.3 Running command: /home/marcel/hooks/before_prepare/01_jshint.js /home/marcel module.js:471 throw err; ^ Error: Cannot find module 'jshint' at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object.<anonymous> (/home/marcel/hooks/before_prepare/01_jshint.js:5:31) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) Error: Hook failed with error code 1: /home/marcel/hooks/before_prepare/01_jshint.js
After install the module with
npm install jshint
This error disappear and the initial error occurs
