Ionic Cordova Platform Installing Error - android

I have been trying to use Ionics CLI to regenerate all of the icon and splash images. So I had to install IOS and Android platforms, I installed IOS without a hitch, but installing android has been giving me a problem. Here is what I get after I run this line in Terminal. Any help would be appreciated.
ionic cordova platform add android
Discovered plugin "cordova-plugin-email-composer" in config.xml. Adding it to the project
Failed to restore plugin "cordova-plugin-email-composer" from config.xml. You might need to try adding it again. Error: Failed to fetch plugin https://github.com/katzer/cordova-plugin-email-composer.git#0.8.2 via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! code ENOPACKAGEJSON
npm ERR! package.json Non-registry package missing package.json: git+https://github.com/katzer/cordova-plugin-email-composer.git#0.8.2.
npm ERR! package.json npm can't find a package.json file in your current directory.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/Fin/.npm/_logs/2018-05-28T14_07_22_673Z-debug.log
Discovered plugin "com.rjfun.cordova.iad" in config.xml. Adding it to the project
Failed to restore plugin "com.rjfun.cordova.iad" from config.xml. You might need to try adding it again. Error: Failed to fetch plugin com.rjfun.cordova.iad#^2.0.4 via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! code E404
npm ERR! 404 Not Found: com.rjfun.cordova.iad#^2.0.4
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/Fin/.npm/_logs/2018-05-28T14_07_31_437Z-debug.log
Running command: /Users/Fin/fflow/hooks/after_prepare/010_add_platform_class.js /Users/Fin/fflow
Running command: /Users/Fin/fflow/hooks/after_prepare/020_remove_sass_from_platforms.js /Users/Fin/fflow
--save flag or autosave detected
Saving android#~7.0.0 into config.xml file ...
[ERROR] Exception:
--save flag or autosave detected
Saving android#~7.0.0 into config.xml file ...
[ERROR] Exception:

Remove old Platform and then install new Platform
cordova platform remove android
cordova platform add android#7.1.0

Related

Failed to fetch platform cordova-android#^8.0.0 in Cordova

Finally after some years of reviewing questions posted by others it's time to write my first one!
Well, I installed Node.js and Cordova (state of the art) as per instructed in this page, but at the beginning I failed to install either platform (iOS or Android).
After many attempts, I decided to give it a last try and run the cordova platform add ios command once again, and incredibly it worked!
Using cordova-fetch for cordova-ios#^5.0.0
Adding ios project...
Creating Cordova project for the iOS platform:
Path: platforms\ios
Package: io.cordova.hellocordova
Name: HelloCordova
iOS project created with cordova-ios#5.1.1
Plugin 'cordova-plugin-whitelist' found in config.xml... Migrating it to package.json
Discovered saved plugin "cordova-plugin-whitelist". Adding it to the project
Installing "cordova-plugin-whitelist" for ios
Adding cordova-plugin-whitelist to package.json
Then, I tried to run cordova platform add android as well, but it failed as usual:
Using cordova-fetch for cordova-android#^8.0.0
Failed to fetch platform cordova-android#^8.0.0
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: npm: Command failed with exit code 4294963214 Error output:
npm WARN helloworld#1.0.0 No repository field.
npm ERR! code EBUSY
npm ERR! syscall rename
npm ERR! path d:\Dropbox\app\node_modules\.staging\android-versions-697b4c50
npm ERR! dest d:\Dropbox\app\node_modules\android-versions
npm ERR! errno -4082
npm ERR! EBUSY: resource busy or locked, rename 'd:\Dropbox\app\node_modules\.staging\android-versions-697b4c50' -> 'd:\Dropbox\app\node_modules\android-versions'
A complete log of the run is available if needed.
Do you have any clue please?
Needless to say I was running the command prompt as administrator, and the C:\Windows\System32 path is already present in the Environment Windows variable.
Thank you,
Fabio
If i see it correctly, u are working in the Dropbox directory. Dropbox may lock files during its sync operation, which interferes with Cordova. Try moving the app to a folder outside of Dropbox.

Failed to add android platform to an ionic project

IM TRYING TO BUILD AN APK AND I GET THIS ERROR
Discovered saved plugin "im.ltdev.cordova.UserAgent". Adding it to the project
Failed to restore plugin "im.ltdev.cordova.UserAgent" from config.xml. You might need to try adding it again. Error: Error: npm: Command failed with exit code 1 Error output:
npm ERR! code E404
npm ERR! 404 Not found : im.ltdev.cordova.UserAgent
npm ERR! 404
npm ERR! 404 'im.ltdev.cordova.UserAgent' is not in the npm registry.
npm ERR! 404 Your package name is not valid, because
npm ERR! 404 1. name can no longer contain capital letters
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Desarrollo\AppData\Roaming\npm-cache\_logs\2020-01-28T17_27_27_131Z-debug.log
Discovered saved plugin "cordova-plugin-firebase". Adding it to the project
Failed to restore plugin "cordova-plugin-firebase" from config.xml. You might need to try adding it again. Error: Failed to fetch plugin git+https://github.com/dpa99c/cordova-plugin-firebase.git#GH-1057-April-05-android-build-issue via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! code ENOGIT
npm ERR! Error while executing:
npm ERR! undefined ls-remote -h -t https://github.com/dpa99c/cordova-plugin-firebase.git
npm ERR!
npm ERR! undefined
npm ERR! No git binary found in $PATH
npm ERR!
npm ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Desarrollo\AppData\Roaming\npm-cache\_logs\2020-01-28T17_27_31_601Z-debug.log
cordova-android-support-gradle-release: Android platform: V7+
cordova-android-support-gradle-release: Wrote custom version '27.+' to C:\Users\Desarrollo\Desktop\lugus-3-0\platforms\android\app\build.gradle
cordova-android-support-gradle-release: Wrote custom version '27.+' to C:\Users\Desarrollo\Desktop\lugus-3-0\platforms\android\cordova-android-support-gradle-release\SanDiego-cordova-android-support-gradle-release.gradle
cordova-plugin-androidx: Updated gradle.properties to enable AndroidX
cordova-plugin-androidx-adapter: Processed 18 Java source files in 450ms
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd platform add android exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
THIS IS MY IONIC INFO
Ionic:
Ionic CLI : 5.4.15 (C:\Users\Desarrollo\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : #ionic/angular 4.0.0-beta.17
#angular-devkit/build-angular : 0.803.23
#angular-devkit/schematics : 7.0.7
#angular/cli : 7.0.7
#ionic/angular-toolkit : 1.2.0
Cordova:
Cordova CLI : not installed
Cordova Platforms : android 8.1.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 2.5.2, (and 10 other plugins)
Utility:
cordova-res : 0.9.0
native-run : not installed
System:
NodeJS : v11.1.0 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10
It seems you have wrong node-module name in package.json.
Please update your package.json to use cordova-plugin-agent , clean up your node_modules directory and NPM cache and install it again.
Hope it helps.
Also please refer to this issue here on github that has same info:

npm errors when the ionic/cordova plugin uses --variable

I have been going through a nightmare so I'd be grateful for any pointer you might have for the below issue.
I have an ionic project that worked perfectly fine and as I was preparing for the final build to push the apk to production, I probably updated something (cordova, npm or ionic) and now cannot install a package if there is a --variable. For instance, the below command
ionic cordova plugin add cordova-plugin-play-games-services --variable APP_ID="XXXXXXX"
throws the following error:
Adding cordova-plugin-play-games-services to package.json
npm: Command failed with exit code 1 Error output:
npm ERR! code EINVALIDTAGNAME
npm ERR! Invalid tag name "APP_ID=XXXXXXXX": Tags may not have any characters that encodeURIComponent encodes.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/myuser/.npm/_logs/2019-11-22T15_05_18_908Z-debug.log
[ERROR] An error occurred while running subprocess cordova.
cordova plugin add cordova-plugin-play-games-services APP_ID=XXXXXXXX exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
The following command on the other hand
ionic cordova plugin add cordova-plugin-admob-free --variable ADMOB_APP_ID="XXXXXXXXXXXXXXX"
gives
Adding cordova-plugin-admob-free to package.json
npm: Command failed with exit code 1 Error output:
npm ERR! code E404
npm ERR! 404 'MyApp' is not in the npm registry.
npm ERR! 404 name can no longer contain capital letters
npm ERR! 404
npm ERR! 404 'MyApp#latest' is not in the npm registry.
npm ERR! 404 Your package name is not valid, because
npm ERR! 404 1. name can no longer contain capital letters
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/myuser/.npm/_logs/2019-11-22T15_10_22_657Z-debug.log
[ERROR] An error occurred while running subprocess cordova.
I can install packages just fine if there is no use of --variable. I have the following environment:
npm -v: 6.12.1
cordova -v: 9.0.0 (cordova-lib#9.0.1)
ionic -v: 5.4.7
I initially thought my npm registry was the problem. I reinstalled it and reinstalled ionic and cordova, which led to no change. I, in fact, created even a brand new linux partition and installed everything from scratch and still get the above problems!
I'd be grateful if you could help me out of this nightmare!
Huge thanks in advance,
Doug

Cordova platform add android error (Construct 2)

apk file with a construct two projects exported via Cordova
I open cmd then I reach to my folder with the exported project and when I try to add android using cmd - "cordova platform add android"
I get this:
'Discovered plugin "cordova-custom-config" in config.xml. Adding it to
the project Failed to restore plugin "cordova-custom-config" from
config.xml. You might need to try adding it again. Error: Failed to
fetch plugin cordova-custom-config via registry. Probably this is
either a connection problem, or plugin spec is incorrect. Check your
connection and plugin name/version/URL. Error: cmd: Command failed
with exit code 1 Error output: npm ERR! code ENOGIT npm ERR! No git
binary found in $PATH npm ERR! npm ERR! Failed using git. npm ERR!
Please check if you have git installed and in your PATH.'
Can someone help me?
do this: cordova platform rm android && cordova platform add android

ionic 2: ionic run android shows error

i have error when i run "ionic run android" or "ionic build android" in my ionic 2 app
this is the error i get. i just tryinh to see my app in the emulator of android.
i tried to make new ionic 2 project but it's the same problem.
Running 'build:before' npm script before build
> ionic-hello-world# build C:\Users\Adir\MyApps\tasklist
> ionic-app-scripts build --rollup ./config/rollup.config.js
[20:16:33] ionic-app-scripts 0.0.30
[20:16:33] build prod started ...
[20:16:33] clean started ...
[20:16:33] clean finished in 24 ms
[20:16:33] copy started ...
[20:16:33] ngc started ...
[20:16:33] lint started ...
[20:16:33] copy finished in 182 ms
[20:16:34] lint finished in 770 ms
[20:16:52] ngc finished in 18.71 s
[20:16:52] bundle prod started ...
[20:16:52] bundle prod failed: Could not resolve entry (/app/main.prod.ts)
[20:16:52] Error: Could not resolve entry (/app/main.prod.ts)
at C:\Users\Adir\MyApps\tasklist\node_modules\rollup\dist\rollup.js:8635:28
at process._tickCallback (internal/process/next_tick.js:103:7)
Error running ionic app script "build": Error: Could not resolve entry (/app/main.prod.ts)
npm
ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! node v6.7.0
npm ERR! npm v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! ionic-hello-world# build: `ionic-app-scripts build --rollup ./config/rollup.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ionic-hello-world# build script 'ionic-app-scripts build --rollup ./config/rollup.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ionic-hello-world package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!
ionic-app-scripts build --rollup ./config/rollup.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ionic-hello-world
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ionic-hello-world
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Adir\MyApps\tasklist\npm-debug.log
Caught exception:
undefined
Mind letting us know? https://github.com/driftyco/ionic-cli/issues
C:\Users\Adir\MyApps\tasklist>
This has been a common issue lately with ionic and A2 and resolving main.prod.*Try updating you app scripts for the project.
npm install #ionic/app-scripts#latest
Your error message should change after that with what is actually causing your build to crash. If the error message changes please update your question with the new message.
Checkout this out as well for more information on this issue: Ionic forum
Close all ionic folders and serve or lab. And try again, ionic cordova build android.
First of all, Check the version of Android in package.json file.
Now remove platform with this command (ionic cordova platform rm android)
After that addd the platform with this command (ionic cordova platform add
android#6.4.0). Where 7.0.0 is not stable version so use 6.4.0
Now, run this command (ionic cordova run android) or in mac (sudo ionic cordova run android)
Try out below command
$ cordova clean android
$ cordova build android
$ ionic cordova build android
There is a path setup problem in your system.
1st check npm version using CMD: npm -v
If it shows version number then use below code, otherwise 1st setup your npm path, you can use gitbash cmd, nodejs cmd
Try to use
ionic cordova run android
or
ionic cordova platform remove android
ionic cordova run android
If you have MAC system must use sudo like
sudo ionic cordova run android

Categories

Resources