Error while getting native targets for android: No valid Android Emulator home found - moodle

root#ubuntu:/home/tesema/moodleapp# npm run prod:android
moodlemobile#4.1.0 prod:android /home/tesema/moodleapp
NODE_ENV=production ionic cordova run android --prod
[ERROR] Error while getting native targets for android: No valid Android Emulator home found.
This error occurred while using native-run. You can try running this command with --no-native-run, which will
revert to using Cordova.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! moodlemobile#4.1.0 prod:android: NODE_ENV=production ionic cordova run android --prod
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the moodlemobile#4.1.0 prod:android script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-12-29T06_59_24_442Z-debug.log
I ma trining to build android APk file by using command npm run prod:android and shows the following error` but it will comply successfully using command npm start. Is there any one has the solution for the above error. how can I generate apk file for android studio

Related

Cordova plugin geolocation not getting installed

I am developing an ionic 4 application. I want to add geolocation plugin and use "ionic cordova plugin add cordova-plugin-geolocation" for the same. On executing the commandI get error
cordova.cmd plugin add cordova-plugin-geolocation
npm: Command failed with exit code 1 Error output:
npm ERR! code E400
npm ERR! 400 Bad Request - GET https://registry.npmjs.org/cordova-plugin-geolocation
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\username\AppData\Roaming\npm-cache\_logs\2019-09-10T08_17_48_727Z-debug.log
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd plugin add cordova-plugin-geolocation exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
Can you use below commands from you ionic project directory
ionic cordova plugin add cordova-plugin-geolocation
npm install #ionic-native/geolocation

Build Failed in ionic 2 for IOS

Running ionic cordova build ios will result in the following error:
Preparing Firebase on iOS
IOS project Code Sign Entitlements now set to: LifeBuddy/Resources/LifeBuddy.entitlements
Entitlements file is in reference section.
Error: ios-deploy was not found. Please download, build and install version 1.9.2 or greater from https://github.com/phonegap/ios-deploy into your path, or do 'npm install -g ios-deploy'
[ERROR] An error occurred while running cordova build ios (exit code 1).
When running the suggested command npm install -g ios-deploy I receive this error:
The following build commands failed:
Check dependencies
Write auxiliary files
(2 failures)
npm ERR! code ELIFECYCLE
npm ERR! errno 65
npm ERR! ios-deploy#1.9.3 preinstall: `./src/scripts/check_reqs.js && xcodebuild`
npm ERR! Exit status 65
npm ERR!
npm ERR! Failed at the ios-deploy#1.9.3 preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/dev-13/.npm/_logs/2018-07-31T08_07_03_860Z-debug.log
Try this,
sudo npm install -g ios-deploy --unsafe-perm=true

Ionic 3 Google Maps Plugins

am using Ionic 3-Angular 4 to build an app, and I am trying to add Google Maps native SDK plugin and I keep getting the following Error:
Error: Failed to fetch plugin file:node_modules/cordova-plugin-googlemaps 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 4294963229 Error output:
npm ERR! path C:\Users\shawe\Desktop\Xampp Server\Ionic\beitelmagdes\node_modules\cordova-plugin-googlemaps\npm-shrinkwrap.json
npm ERR! code ELOOP
npm ERR! errno -4067
npm ERR! syscall open
npm ERR! ELOOP: too many symbolic links encountered, open 'C:\Users\shawe\Desktop\Xampp Server\Ionic\beitelmagdes\node_modules\cordova-plugin-googlemaps\npm-shrinkwrap.json'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\shawe\AppData\Roaming\npm-cache_logs\2017-11-16T07_43_23_428Z-debug.log
[ERROR] An error occurred while running cordova plugin add cordova-plugin-googlemaps --variable
API_KEY_FOR_ANDROID=AIza... (exit code 1).
Please Help
I was having the same problem and seemed to be an issue with the repro. It is now working nicely if you follow the ionic-native documentation:
https://ionicframework.com/docs/native/google-maps/
$ ionic cordova plugin add cordova-plugin-googlemaps --variable
API_KEY_FOR_ANDROID="YOUR_ANDROID_API_KEY_IS_HERE" --variable
API_KEY_FOR_IOS="YOUR_IOS_API_KEY_IS_HERE"
$ npm install --save #ionic-native/google-maps

Issus Ionic Cordova platform add IOS

ionic Cordova platform and IOS
✖ Cordova platform adds ios --save - failed!
[ERROR] Exception: Using Cordova-fetch for Cordova-ios#^4.4.0
Error: Failed to fetch platform `cordova-ios#^4.4.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 254 Error output:
npm ERR! path
/Users/zion/Desktop/RSSFeederApp/node_modules/node_modules/file:cordova-dist-dev/CB-11690/cordova-common-1.4.1.tgz
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall stat
npm ERR! enoent ENOENT: no such file or directory, stat
'/Users/zion/Desktop/RSSFeederApp/node_modules/node_modules/file:cordova-dist-dev/CB-11690/cordova-common-1.4.1.tgz'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/zion/.npm/_logs/2017-08-31T07_48_01_154Z-debug.log
This issue is related to npm 5.3.0.
It is best to downgrade to 5.2.0 using npm install -g npm#5.2.0
For us this is most commonly caused by npm's broken lockfile approach.
To resolve it, delete the package-lock.json and run your command again.
try this, and make sure you are using Mac
ionic platform add ios

Can not create ionic 2 app

I am following the ionic installation guide, but when I want to create app it give me error.
The command I enter is:
ionic start cutePuppyPics --v2
The error it gives is:
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files (x86)\\Nodist\\v\\nodev7.0.0\\node.exe" "C:\\Program Files (x86)\\Nodist\\bin\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v7.0.0
npm ERR! npm v3.10.6
npm ERR! code ELIFECYCLE
npm ERR! node-sass#3.9.3 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#3.9.3 postinstall script 'node scripts/build.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 node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/build.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-sass
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls node-sass
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! E:\nodeProjects\ionic\cutePuppyPics\npm-debug.log
Error with start undefined
Error Initializing app: There was an error with the spawned command: npminstall
There was an error with the spawned command: npminstall
Caught exception:
undefined
Mind letting us know? https://github.com/driftyco/ionic-cli/issues
Node v7.0.0 causes this problem. Instead of nodejs v7.0.0 use nodejs v6.9.1 or install LTS version of node from https://nodejs.org/en/download
You don't have to use --v2 when creating your project. Just type
ionic start cutePuppyPics blank
--v2 is not working with latest ionic. you can use
ionic start cutePuppyPics ionic-angular (for ionic 2.x)
ionic start cutePuppyPics ionic1 (ionic 1.x)