I'm unable to add android platform in ionic - android

From today i am facing a problem in ionic to add android platform.
when i run ionic cordova platform add android i found following Error:
Please help me.
C:\Users\kamal\Desktop\desktop>ionic cordova platform add android
[INFO] Enabling Cordova integration.
ionic config set integrations.cordova {} --json --force
[OK] integrations.cordova set to {} in .\ionic.config.json!
cordova platform add android --save
× Running command - failed!
[ERROR] Exception: Using cordova-fetch for cordova-android#~6.3.0
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms\android
Package: io.ionic.starter
Name: MyApp
Activity: MainActivity
Android target: android-26
Subproject Path: CordovaLib
Android project created with cordova-android#6.3.0
Discovered plugin "ionic-plugin-keyboard" in config.xml. Adding it to the project
Installing "ionic-plugin-keyboard" for android
Adding ionic-plugin-keyboard to package.json
Saved plugin info for "ionic-plugin-keyboard" to config.xml
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" for android
This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a
previous platform version, you do *not* need this plugin since the whitelist will be built in.
Adding cordova-plugin-whitelist to package.json
Saved plugin info for "cordova-plugin-whitelist" to config.xml
Discovered plugin "cordova-plugin-statusbar" in config.xml. Adding it to the project
Failed to restore plugin "cordova-plugin-statusbar" from config.xml. You might need to try adding it again.
Error: Failed to fetch plugin https://github.com/apache/cordova-plugin-statusbar.git 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! git clone
C:\Users\kamal\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92
C:\Users\kamal\AppData\Local\Temp\npm-5316-596ddc1c\git-cache-f1f0edfd\08127bf674bcfc5a161466a4c19e8fd21f726892:
Cloning into
'C:\Users\kamal\AppData\Local\Temp\npm-5316-596ddc1c\git-cache-f1f0edfd\08127bf674bcfc5a161466a4c19e8fd21f726892'...
npm ERR! git clone
C:\Users\kamal\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92
C:\Users\kamal\AppData\Local\Temp\npm-5316-596ddc1c\git-cache-f1f0edfd\08127bf674bcfc5a161466a4c19e8fd21f726892:
git-upload-pack
'C:\Users\kamal\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92':
git-upload-pack: command not found
npm ERR! git clone
C:\Users\kamal\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92
C:\Users\kamal\AppData\Local\Temp\npm-5316-596ddc1c\git-cache-f1f0edfd\08127bf674bcfc5a161466a4c19e8fd21f726892:
fatal: Could not read from remote repository.
npm ERR! git clone
C:\Users\kamal\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92
C:\Users\kamal\AppData\Local\Temp\npm-5316-596ddc1c\git-cache-f1f0edfd\08127bf674bcfc5a161466a4c19e8fd21f726892:
npm ERR! git clone
C:\Users\kamal\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92
C:\Users\kamal\AppData\Local\Temp\npm-5316-596ddc1c\git-cache-f1f0edfd\08127bf674bcfc5a161466a4c19e8fd21f726892:
Please make sure you have the correct access rights
npm ERR! git clone
C:\Users\kamal\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92
C:\Users\kamal\AppData\Local\Temp\npm-5316-596ddc1c\git-cache-f1f0edfd\08127bf674bcfc5a161466a4c19e8fd21f726892:
and the repository exists.
npm ERR! git clone
C:\Users\kamal\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92
C:\Users\kamal\AppData\Local\Temp\npm-5316-596ddc1c\git-cache-f1f0edfd\08127bf674bcfc5a161466a4c19e8fd21f726892:
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program
Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
"https://github.com/apache/cordova-plugin-statusbar.git" "--production" "--save"
npm ERR! node v6.11.4
npm ERR! npm v3.10.10
npm ERR! code 128
npm ERR! Command failed: git -c core.longpaths=true clone
C:\Users\kamal\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92
C:\Users\kamal\AppData\Local\Temp\npm-5316-596ddc1c\git-cache-f1f0edfd\08127bf674bcfc5a161466a4c19e8fd21f726892
npm ERR! Cloning into
'C:\Users\kamal\AppData\Local\Temp\npm-5316-596ddc1c\git-cache-f1f0edfd\08127bf674bcfc5a161466a4c19e8fd21f726892'...
npm ERR! git-upload-pack
'C:\Users\kamal\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-statusbar-git-c66a3d92':
git-upload-pack: command not found
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\kamal\Desktop\desktop\npm-debug.log
Discovered plugin "cordova-plugin-device" in config.xml. Adding it to the project
Installing "cordova-plugin-device" for android
Adding cordova-plugin-device to package.json
Saved plugin info for "cordova-plugin-device" to config.xml
Discovered plugin "cordova-plugin-splashscreen" in config.xml. Adding it to the project
Installing "cordova-plugin-splashscreen" for android
Adding cordova-plugin-splashscreen to package.json
Saved plugin info for "cordova-plugin-splashscreen" to config.xml
Discovered plugin "cordova-plugin-ionic-webview" in config.xml. Adding it to the project
Installing "cordova-plugin-ionic-webview" for android
Adding cordova-plugin-ionic-webview to package.json
Saved plugin info for "cordova-plugin-ionic-webview" to config.xml
--save flag or autosave detected
Saving android#~6.3.0 into config.xml file ...
My ionic info
#ionic/cli-utils : 1.13.0
ionic (Ionic CLI) : 3.13.0
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
#ionic/app-scripts : 3.0.0
Cordova Platforms : none
Ionic Framework : ionic-angular 3.7.1
System:
Android SDK Tools : 26.1.1
Node : v6.11.4
npm : 3.10.10
OS : Windows 10
Misc:
backend : pro

try installing the 6.11.4 LTS version of node.js (marked as recommended for most users)

Related

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:

Ionic Cordova Platform Installing Error

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

Transpile errors with cordova-plugin-file-transfer

I want to use the cordova file transfer plugin. I'm using it through the Ionic-Native transfer module.
The app won't run because there is a transpile error with the file transfer plugin and the file plugin:
transpile started ...
typescript: plugins/cordova-plugin-file-transfer/types/index.d.ts, line: 9
Cannot find type definition file for 'cordova-plugin-file'.
L8: * #param server URL of the server to receive the file, as encoded by encodeURI().
L9: * #param successCallback A callback that is passed a FileUploadResult object.
L10: * #param errorCallback A callback that executes if an error occurs retrieving the FileUploadResult.
I installed #types/cordova-plugin-file through npm, but the app won't run because of duplicate identifiers in the two cordova-plugin-file packages:
transpile started ...
typescript: node_modules/#types/cordova-plugin-file/index.d.ts, line: 376
Duplicate identifier 'PERSISTENT'.
typescript: node_modules/#types/cordova-plugin-file/index.d.ts, line: 377
Duplicate identifier 'TEMPORARY'.
typescript: plugins/cordova-plugin-file/types/index.d.ts, line: 376
Duplicate identifier 'PERSISTENT'.
typescript: plugins/cordova-plugin-file/types/index.d.ts, line: 377
Duplicate identifier 'TEMPORARY'.
What is the right approach here?
As mentioned, it looks like the typings in cordova-plugin-file-transfer are incorrect.
It should be an external module but it is currently a script file (copied from DefinitelyTyped directly).
On the other hand, since cordova-plugin-file already includes its own typings, you don't need to install #types/cordova-plugin-file.
I experienced this issue as well.
However I was able to work around the issue with the following operations:
Setup :
```
Your system information:
Cordova CLI: 6.5.0
Ionic Framework Version: 2.3.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.2.1
ios-deploy version: 1.9.1
ios-sim version: 5.0.13
OS: macOS Sierra
Node Version: v7.7.4
Xcode version: Xcode 8.2.1 Build version 8C1002
```
Initial Problem :
```
$ ionic build ios
Running 'build:before' npm script before build
> apoc# build /Users/js/dev/apoc-ochem/app_v3/apoc
> ionic-app-scripts build
[01:47:59] ionic-app-scripts 1.2.1
[01:47:59] build dev started ...
[01:47:59] clean started ...
[01:47:59] clean finished in 2 ms
[01:47:59] copy started ...
[01:47:59] transpile started ...
[01:48:04] typescript: plugins/cordova-plugin-file-transfer/types/index.d.ts, line: 9
Cannot find type definition file for 'cordova-plugin-file'.
L8: * #param server URL of the server to receive the file, as encoded by encodeURI().
L9: * #param successCallback A callback that is passed a FileUploadResult object.
L10: * #param errorCallback A callback that executes if an error occurs retrieving the FileUploadResult.
[01:48:04] ionic-app-script task: "build"
[01:48:04] Error: Failed to transpile program
Error: Failed to transpile program
at new BuildError (/Users/js/dev/apoc-ochem/app_v3/apoc/node_modules/#ionic/app-scripts/dist/util/errors.js:16:28)
at /Users/js/dev/apoc-ochem/app_v3/apoc/node_modules/#ionic/app-scripts/dist/transpile.js:102:20
at transpileWorker (/Users/js/dev/apoc-ochem/app_v3/apoc/node_modules/#ionic/app-scripts/dist/transpile.js:68:12)
at Object.transpile (/Users/js/dev/apoc-ochem/app_v3/apoc/node_modules/#ionic/app-scripts/dist/transpile.js:26:12)
at buildProject (/Users/js/dev/apoc-ochem/app_v3/apoc/node_modules/#ionic/app-scripts/dist/build.js:98:78)
at /Users/js/dev/apoc-ochem/app_v3/apoc/node_modules/#ionic/app-scripts/dist/build.js:46:16
npm ERR! Darwin 16.4.0
npm ERR! argv "/Users/js/.nvm/versions/node/v7.7.4/bin/node" "/Users/js/.nvm/versions/node/v7.7.4/bin/npm" "run" "build"
npm ERR! node v7.7.4
npm ERR! npm v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! apoc# build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the apoc# build script 'ionic-app-scripts build'.
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 apoc package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ionic-app-scripts build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs apoc
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls apoc
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR!
/Users/js/dev/apoc-ochem/app_v3/apoc/npm-debug.log
```
Steps for Work Around:
Remove Platform
Remove Cordova plugin
Rebuild project
Add Platform
Remove cordova-plugin-file-transfer plugin
Rebuild ios project
```
$ cordova plugin rm cordova-plugin-file-transfer
Removing "cordova-plugin-file-transfer"
$ ionic build ios
...
...
[02:01:20] lint finished in 3.70 s
Error: No platforms added to this project. Please use `cordova platform add <platform>`.
$ ionic platforms add ios
Adding ios project...
Creating Cordova project for the iOS platform:
Path: platforms/ios
Package: com.nielssievertsen.apocsocial
Name: apoc social
iOS project created with cordova-ios#4.3.1
Installing "com.synconset.imagepicker" for ios
Installing "cordova-plugin-camera" for ios
Fetching plugin "cordova-plugin-compat" via npm
Installing "cordova-plugin-compat" for ios
Installing "cordova-plugin-console" for ios
Installing "cordova-plugin-device" for ios
Installing "cordova-plugin-device-motion" for ios
Installing "cordova-plugin-facebook4" for ios
Installing "cordova-plugin-googleplus" for ios
Google Sign-In prerequisites
START Running hook to add iOS Keychain Sharing entitlements (required since iOS 10)
Will add iOS Keychain Sharing entitlements to project 'apoc social'
END Running hook to add iOS Keychain Sharing entitlements (required since iOS 10)
Installing "cordova-plugin-media-capture" for ios
Fetching plugin "cordova-plugin-file" via npm
Installing "cordova-plugin-file" for ios
Dependent plugin "cordova-plugin-compat" already installed on ios.
Dependent plugin "cordova-plugin-compat" already installed on ios.
Installing "cordova-plugin-nativestorage" for ios
Installing "cordova-plugin-shake" for ios
Dependent plugin "cordova-plugin-device-motion" already installed on ios.
Installing "cordova-plugin-splashscreen" for ios
Installing "cordova-plugin-statusbar" for ios
Installing "cordova-plugin-whitelist" for ios
Installing "cordova-sqlite-storage" for ios
installing external dependencies via npm
npm install of external dependencies ok
Installing "ionic-plugin-keyboard" for ios
Installing "phonegap-plugin-push" for ios
Discovered plugin "cordova-plugin-file-transfer" in config.xml. Adding it to the project
Fetching plugin "cordova-plugin-file-transfer#~1.6.1" via npm
Installing "cordova-plugin-file-transfer" for ios
Dependent plugin "cordova-plugin-file" already installed on ios.
$ cordova plugin rm cordova-plugin-file-transfer
Uninstalling cordova-plugin-file-transfer from ios
Removing "cordova-plugin-file-transfer"
"cordova-plugin-file" is required by (cordova-plugin-media-capture) and cannot be removed (hint: use -f or --force)
"cordova-plugin-compat" is required by (cordova-plugin-camera, cordova-plugin-media-capture) and cannot be removed (hint: use -f or --force)
$ ionic build ios
............
...
** BUILD SUCCEEDED **
```
Looks like the typings in cordova-plugin-file-transfer is incorrect.
It should be an external module but it is currently a script file (copied from DefinitelyTyped directly).
You should file an issue there.
On the other hand, since cordova-plugin-file already includes its own typings, you don't need to install #types/cordova-plugin-file.
It seems the "plugin/" folder is cordova plugins for ionic2, which you may not need to perform typescript compilation,
You can always ignore the index.d.ts by specifying the exclude target from tsconfig.json
For Ionic there is file called tsconfig.build.json
in it compiler option add below parameter.
"skipLibCheck": true
it should look like this
{
"extends": "...anytest....",
"compilerOptions": {
"baseUrl": ".",
"target": "es5",
"skipLibCheck": true
},
"exclude": [
"...your config here..."
]
}

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

Ionic is Not Installing on Windows 7 - Getting Many Errors

I am getting this error while i am trying to install Ionic
$ npm install ionic cordova -g
npm ERR! not a package C:\Users\Sridhar\AppData\Roaming\npm-cache\ansi-regex\2.0.0\package.tgz
npm ERR! not a package C:\Users\Sridhar\AppData\Roaming\npm-cache\ansi-regex\2.0.0\package.tgz
npm ERR! not a package C:\Users\Sridhar\AppData\Roaming\npm-cache\ansi-regex\2.0.0\package.tgz
npm WARN engine xmlbuilder#2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"4.2.2","npm":"2.14.7"})
npm ERR! not a package C:\Users\Sridhar\AppData\Roaming\npm-cache\ansi-regex\2.0.0\package.tgz
npm ERR! not a package C:\Users\Sridhar\AppData\Roaming\npm-cache\ansi-regex\2.0.0\package.tgz
npm ERR! not a package C:\Users\Sridhar\AppData\Roaming\npm-cache\delayed-stream\0.0.5\package.tgz
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "ionic" "cordova" "-g"
npm ERR! node v4.2.2
npm ERR! npm v2.14.7
npm ERR! path C:\Users\Sridhar\AppData\Roaming\npm\node_modules\ionic\node_modules\npm\node_modules\read-installed
npm ERR! code UNKNOWN
npm ERR! errno -4094
npm ERR! syscall scandir
npm ERR! UNKNOWN: unknown error, scandir 'C:\Users\Sridhar\AppData\Roaming\npm\node_modules\ionic\node_modules\npm\node_modules\read-installed'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! error rolling back Error: UNKNOWN: unknown error, scandir 'C:\Users\Sridhar\AppData\Roaming\npm\node_modules\ionic\node_modules\npm\node_modules\read-installed'
npm ERR! error rolling back at Error (native)
npm ERR! error rolling back { [Error: UNKNOWN: unknown error, scandir 'C:\Users\Sridhar\AppData\Roaming\npm\node_modules\ionic\node_modules\npm\node_modules\read-installed']
npm ERR! error rolling back errno: -4094,
npm ERR! error rolling back code: 'UNKNOWN',
npm ERR! error rolling back syscall: 'scandir',
npm ERR! error rolling back path: 'C:\\Users\\Sridhar\\AppData\\Roaming\\npm\\node_modules\\ionic\\node_modules\\npm\\node_modules\\read-installed' }
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Sridhar\npm-debug.log
Please help me to install Ionic
Please follow the below steps to install ionic.
IONIC Setup
Setup Environment (Installations)
Install Node.js
a. http://nodejs.org/download/
install ionic framework
a. $ npm install -g cordova ionic
install android SDK and set environment variables
a. Set following environment variable
b. set ANDROID_HOME=C:\\android-sdk-windows
Install Android Target 19 (follow following steps)
Open the SDK Manager (typing android into the terminal, assuming it's in your file path)
Selected box next to Android 4.4.2 (API 19)
Clicked button Install 8 packages
Install ant using CMD window
npm Install -g ant
a. Add following path in environment variables (PATH):
C:\Users\user.name\AppData\Roaming\npm\node_modules\ant\ant\bin
Once you setup the ionic environment.
Create the basic application for testing.
Open node.js command prompt
ionic start myApp tabs
cd myApp
ionic serve (it will open the application in browser)
ionic platform add android (replace ios with android if you want to add iOS platform)
ionic build android (replace ios with android if you want to build in iOS platform)
ionic emulate android android (replace ios with android if you want to emulate iOS platform)
NOTE: If ERR occurs, follow below link:
installing ionic npm ERR! tar.unpack error
Have you followed the right installation sequence ?
Install or update Node.js
Download the most recent version of Node.js. If you are running an older version of Node, make sure to update it because older versions had issues with npm.
As with the other commands, nodejs should now function in cmd.exe but just to be careful, add the full path to the bin folder in Node to your PATH, which will look something like C:\Program Files\nodejs\bin
Install Cordova
Open a new cmd.exe window, and run:
$ npm install -g cordova
Install Ionic
$ npm install -g ionic
Find the official installation doc and this too for more.

Categories

Resources