Found an issue when add android platform in Ionic? how I resolve this?


#1

Using cordova-fetch for cordova-android@7.0.0
Error: Failed to fetch platform cordova-android@7.0.0
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: cmd: Command failed with exit code ENOENT

[ERROR] Exception:


#2

The following commands are:

npm uninstall cordova -g

npm cache clean

npm install cordova -g


#3

npm ERR! As of npm@5, the npm cache self-heals from corruption issues and data e
xtracted from the cache is guaranteed to be valid. If you want to make sure ever
ything is consistent, use ‘npm cache verify’ instead.
npm ERR!
npm ERR! If you’re sure you want to delete the entire cache, rerun this command
with --force.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\HP\AppData\Roaming\npm-cache_logs\2017-12-19T06_38_34_718
Z-debug.log

I got error this error in npm cache clean.


#4

ok ignore
npm cache clean.


#5

Still i found the same issue…


#6

I would suggest to remove node_modules folder and run
npm install


#7

I got the below output while reinstall npm

npm WARN Invalid name: "Teen TV"
npm WARN Teen TV No description
npm WARN Teen TV No repository field.
npm WARN Teen TV No README data
npm WARN Teen TV No license field.
added 4 packages in 2.486s

and also again same issue…


#8

can use share screenshort of your package.json file


#9

{
“name”: “myApp”,
“version”: “0.0.1”,
“author”: “Ionic Framework”,
“homepage”: “http://ionicframework.com/”,
“private”: true,
“scripts”: {
“clean”: “ionic-app-scripts clean”,
“build”: “ionic-app-scripts build”,
“lint”: “ionic-app-scripts lint”,
“ionic:build”: “ionic-app-scripts build”,
“ionic:serve”: “ionic-app-scripts serve”
},
“dependencies”: {
"@angular/common": “5.0.3”,
"@angular/compiler": “5.0.3”,
"@angular/compiler-cli": “5.0.3”,
"@angular/core": “5.0.3”,
"@angular/forms": “5.0.3”,
"@angular/http": “5.0.3”,
"@angular/platform-browser": “5.0.3”,
"@angular/platform-browser-dynamic": “5.0.3”,
"@ionic-native/core": “4.4.0”,
"@ionic-native/screen-orientation": “^4.5.2”,
"@ionic-native/splash-screen": “4.4.0”,
"@ionic-native/status-bar": “4.4.0”,
"@ionic-native/streaming-media": “^4.5.2”,
"@ionic/storage": “2.1.3”,
“com.hutchind.cordova.plugins.streamingmedia”: “~0.1.4”,
“cordova-android”: “^7.0.0”,
“cordova-plugin-device”: “1.1.4”,
“cordova-plugin-ionic-webview”: “^1.1.11”,
“cordova-plugin-screen-orientation”: “^2.0.2”,
“cordova-plugin-splashscreen”: “~4.0.1”,
“cordova-plugin-streaming-media”: “^1.0.2”,
“cordova-plugin-whitelist”: “1.3.1”,
“es6-promise-plugin”: “^4.1.1”,
“ionic-angular”: “3.9.2”,
“ionic-plugin-keyboard”: “~2.2.1”,
“ionicons”: “3.0.0”,
“rxjs”: “5.5.2”,
“sw-toolbox”: “3.6.0”,
“zone.js”: “0.8.18”
},
“devDependencies”: {
"@ionic/app-scripts": “3.1.5”,
“typescript”: “2.4.2”
},
“description”: “An Ionic project”,
“cordova”: {
“plugins”: {
“com.hutchind.cordova.plugins.streamingmedia”: {},
“ionic-plugin-keyboard”: {},
“cordova-plugin-whitelist”: {},
“cordova-plugin-device”: {},
“cordova-plugin-splashscreen”: {},
“cordova-plugin-ionic-webview”: {}
},
“platforms”: []
}
}


#10

replace “cordova-android”: "^7.0.0, with “cordova-android”: “6.3.0”,
save and run
npm install


#11

no change still get same issue.


#12

try this
ionic cordova platform remove android
ionic cordova platform add android


#13

Capture

when I give ionic cordova platform remove android


#14

you have to perform all these step in your ionic project floder

E:\ionic3\MMPApp>cd mmpapp

E:\ionic3\MMPApp\mmpapp>ionic cordova platform remove android

cordova platform remove android --save
Removing platform android from config.xml file…

Removing android from cordova.platforms array in package.json

E:\ionic3\MMPApp\mmpapp>ionic cordova platform add android

cordova platform add android --save
Using cordova-fetch for cordova-android@~6.3.0

Adding android project…

Creating Cordova project for the Android platform:

    Path: platforms\android
    Package: com.MMPApp
    Name: MMPApp
    Activity: MainActivity
    Android target: android-26

Subproject Path: CordovaLib
Android project created with cordova-android@6.3.0

Installing “com.synconset.imagepicker” for android
Subproject Path: CordovaLib
Installing “cordova-plugin-camera” for android
Subproject Path: CordovaLib
Installing “cordova-plugin-console” for android

Installing “cordova-plugin-device” for android
Installing “cordova-plugin-ionic-webview” for android

Installing “cordova-plugin-network-information” for android

Installing “cordova-plugin-splashscreen” for android

Installing “cordova-plugin-whitelist” for android

           This plugin is only applicable for versions of cordova-android

eater than 4.0. If you have a previous platform version, you do not need thi
plugin since the whitelist will be built in.

Installing “cordova-plugin-x-toast” for android

Installing “cordova-sqlite-storage” for android

installing external dependencies via npm
npm install of external dependencies ok
Installing “cordova.plugins.diagnostic” for android
Subproject Path: CordovaLib
Installing “ionic-plugin-keyboard” for android
–save flag or autosave detected

Saving android@~6.3.0 into config.xml file …

ionic cordova resources android --force
√ Collecting resource configuration and source images - done!
√ Filtering out image resources that do not need regeneration - done!
√ Uploading source images to prepare for transformations - done!
√ Generating platform resources: 18 / 18 complete - done!
√ Modifying config.xml to add new image resources - done!

E:\ionic3\MMPApp\mmpapp>


#15

what is the environmental setup for these?


#16

@nocture What are you doing here? All your advice has been pretty shit and unrelevant for @AnbuR.


#17

@AnbuR

What command are you running to get the error from your initial post?

What is your ionic info output?


#18

[ERROR] Error with .\node_modules\ionic-angular\package.json file:
FILE_NOT_FOUND
[ERROR] Error with .\node_modules@ionic\app-scripts\package.json file:
FILE_NOT_FOUND

cli packages: (C:\Users\HP\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.19.0
ionic (Ionic CLI) : 3.19.0

global packages:

cordova (Cordova CLI) : 6.5.0

local packages:

@ionic/app-scripts : not installed
Cordova Platforms  : none
Ionic Framework    : not installed

System:

Node : v8.9.3
npm  : 5.6.0
OS   : Windows 7

Environment Variables:

ANDROID_HOME : not set

Misc:

backend : pro

#19

try to delete your node_module folder and run npm install


#20

I run NPM install this is the output

npm WARN Invalid name: "myApp"
npm WARN Teen TV No description
npm WARN Teen TV No repository field.
npm WARN Teen TV No README data
npm WARN Teen TV No license field.

added 4 packages in 5.137s

Capture