ionic1 Error: gfs.gracefulify is not a function - android

i am trying this command sudo ionic platform add android it shows me below error.
Error: gfs.gracefulify is not a function
My versoin
Cordova CLI: 6.4.0
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
Node Version: v4.4.2
what happnes i dont know. pls help me. thanks in advance

This is most probably related to a quirk/bug in npm 3.x.
Try upgrading to the latest stable node 5.10.1 and reinstalling ionic

Goto
/usr/local/lib/node_modules/cordova/node_modules/
rename the npm-directory to something else.
Now, Cordova will use the global (and hopefully correct) npm.

Related

fs-extra: source and destination must not be the same. (cordova)

I get an error while building with cordova.
Error: Source and destination must not be the same.
Build-System:
Ionic:
ionic (cli): 4.10.1
ionic framework: ionic-angular 3.9.2
#ionic/app-scripts: 3.1.11
Cordova:
cordova (cli): 8.1.2 (cordova-lib#8.1.1)
platforms: "cordova-android": "8.0.0"
System:
Android SDK Tools: 26.1.1
NodeJS: 10.15.3
npm: 6.4.1
OS: Windows 10
Command:
ionic cordova build android
or
cordova build --release
Error-Details:
Error: Source and destination must not be the same.
at checkPaths (C:\Jenkins\workspace\%PROJECTNAME%\node_modules\fs-extra\lib\copy-sync\copy-sync.js:185:11)
at Object.copySync (C:\Jenkins\workspace\%PROJECTNAME%\node_modules\fs-extra\lib\copy-sync\copy-sync.js:25:20)
at updatePathWithStats (C:\Jenkins\workspace\%PROJECTNAME%\node_modules\cordova-common\src\FileUpdater.js:103:24)
at C:\Jenkins\workspace\%PROJECTNAME%\node_modules\cordova-common\src\FileUpdater.js:298:19
at Array.forEach (<anonymous>)
at Object.mergeAndUpdateDir (C:\Jenkins\workspace\%PROJECTNAME%\node_modules\cordova-common\src\FileUpdater.js:296:33)
at updateWww (C:\Jenkins\workspace\%PROJECTNAME%\platforms\android\cordova\lib\prepare.js:157:17)
at Api.module.exports.prepare (C:\Jenkins\workspace\%PROJECTNAME%\platforms\android\cordova\lib\prepare.js:56:19)
at Api.prepare (C:\Jenkins\workspace\%PROJECTNAME%\platforms\android\cordova\Api.js:177:45)
at C:\Jenkins\workspace\%PROJECTNAME%\node_modules\cordova\node_modules\cordova-lib\src\cordova\prepare.js:105:36
Does anyone facing the same error or has an idea what's wrong?
Additional infos:
I always check out the git repository to a empty folder. This means: It's a hard-clean every build. No node_modules and no platform, etc. (rm platform etc. is useless)
I don't know if this is the correct answer, but it could be a wrong setting in the cordova build.json (if you have one).
Since you are using Jenkins, maybe you have some wrong settings there like missing dependencies or something like that.
You can also try to remove the platform and add it again to get the latest version and compatibility.
cordova platform remove android
cordova platform add android#8.0.0
You can check if you have an outdated fs-extra (although I don't think that is the problem) and update Ionic.
You can try to restore your node_modules.
I hope one of these steps help.
At first, manually remove this:
node_modules folder
package-lock.json file
platform > android folder
then use this commend:
1 => npm rm -rf node_modules package-lock.json
2 => npm cache clear --force
3 => ionic cordova platform add android#8.0.0
4 => ionic cordova prepare android
5 => ionic cordova run android
The problem is fs-extra checkPaths method of copy operation. There is a check of state.ino (inode) of node fs which is evaluated as number. Bigint is also supported but not enabled. This is the reason that the comparsion can fail. Because max-safe-integer in JavaScript is 53-bit. Maybe also a symlink issue.
See / Join:
https://github.com/jprichardson/node-fs-extra/issues/657
Why Cordova-Android 8.0.0?
Because https://github.com/apache/cordova-common/blob/master/RELEASENOTES.md . fs-extra is new in this version.
In my case it happened while removing/adding android again to make sure that some plugins are updated.
This solution fixed my issue as referenced here
cordova clean android

Ionic + Angular - Platform Add Android Error - Error: Failed to fetch platform cordova-android#0.0.8

Okay, so you run this. And it continues to fail.
cordova platform add android --save
And the output is this.
Error: Failed to fetch platform cordova-android#0.0.8
After trying to reinstall cordova, node, and other packages, I have had no luck. I am running this with the ionic blank starter package with ionic Cli 3.
For some reason with the latest version of everything, ionic, angular, the cli, etc, the platform was trying to add
cordova-android#0.0.8
To fix this, just go to this link and get the latest version, and run this...
sudo ionic cordova platform add android#6.4.0
I had the same issue and followed this link
https://github.com/apache/cordova-android/releases
There, I found that the latest version is 7.1.1
I tried this ionic cordova platform add android#7.1.1 but got the same error
From a forum I follow, I got this link https://www.npmjs.com/package/cordova-android
Then I tried this ionic cordova platform add android#7.1.0 and it ran as I expected
remove old android
ionic cordova platform rm android
add latest android
ionic cordova platform add android#latest

Ionic - Error: Cannot find module 'android-versions'

When a try to run
ionic run android --device
I'm getting an error of module:
Error: Cannot find module 'android-versions'
Versions:
java -version
java version "1.8.0_144"
Android studio Version 2.3.3
ionic -v
2.2.1
cordova -v
6.5.0
I found the problem and expect help somebody.
I just run
npm install android-versions --save
in the project folder and worked.
Not sure if this will help some other Ionic developers, but I was getting the same Error: Cannot find module 'android-versions' and I fixed it by removing and adding the Android platform again:
ionic cordova platform remove android --save
And then
ionic cordova platform add android --save
If anyone is having this issue while using yarn and even after adding android-versions... it seems that there are differences in yarn/npm files which break...
I ended up removing my node_modules folder, then installing it with npm instead of yarn. It worked!

ionic unable to add SocialSharing-PhoneGap-Plugin

I am trying to use SocialSharing-PhoneGap-Plugin in my first app development,
https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin#web-share-api
I have tried following command :
cordova plugin add SocialSharing-PhoneGap-Plugin
cordova plugin add https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git
but It gives me same error , Anyone know what the problem is?
Some plugins can install in specific versions of cordova.
so please downgrade your cordova version and try to install that plugin again.
if your cordova version is 7+, downgrade to 6.5.0
npm install -g cordova#6.5.0
The plugin name is case sensitive, so the right one is:
cordova plugin rm cordova-plugin-x-socialsharing

Can't build app with Ionic

I am no longer able to build my app and generate an apk anymore because an error shows up. Here is what happens when I try to build the app in the command prompt: Command Prompt
Can somebody please help me with this? Oh and this is what happens if I type ionic info in the command prompt:
Your environment has been set up for using Node.js 0.12.4 (x64) and npm.
C:\Users\Singh>ionic info
Your system information:
Cordova CLI: 5.1.1
Ionic CLI Version: 1.6.1
Ionic App Lib Version: 0.3.3
OS: Windows 7 SP1
Node Version: v0.12.4
C:\Users\Singh>
Try to remove the platform, and then add it again, and then build your application.
So, if you have android as targeted platform execute these commands:
ionic platform remove android
ionic platform add android
ionic build android
My son had a very similar problem, and we never did figure out what caused it. He ended up creating a brand new blank ionic project, and then just copying the www folder from the old project. It worked, and he was able to get things building again. If you try it, you'll also have to re-add your plugins, copy package.json and bower.json, and then rerun bower install and npm install. It's not pleasant, but it might be worth a shot if you're desperate.

Categories

Resources