Skip to content
This repository has been archived by the owner on Apr 2, 2018. It is now read-only.

Not compatible with cordova-android 7.0.0 #304

Open
Mokto opened this issue Dec 11, 2017 · 20 comments
Open

Not compatible with cordova-android 7.0.0 #304

Mokto opened this issue Dec 11, 2017 · 20 comments

Comments

@Mokto
Copy link

Mokto commented Dec 11, 2017

Hi,

When trying to install :

Failed to install 'ionic-plugin-keyboard': Error: ENOENT: no such file or directory, open '/Users/theo/Projects/mobile/platforms/android/AndroidManifest.xml'
    at Object.fs.openSync (fs.js:651:18)
    at Object.fs.readFileSync (fs.js:553:33)
    at Object.parseElementtreeSync (/Users/theo/Projects/mobile/platforms/android/cordova/node_modules/cordova-common/src/util/xml-helpers.js:180:27)
    at new AndroidManifest (/Users/theo/Projects/mobile/platforms/android/cordova/lib/AndroidManifest.js:29:20)
    at AndroidProject.getPackageName (/Users/theo/Projects/mobile/platforms/android/cordova/lib/AndroidProject.js:99:12)
    at Api.addPlugin (/Users/theo/Projects/mobile/platforms/android/cordova/Api.js:223:57)
    at handleInstall (/Users/theo/.nvm/versions/node/v8.1.2/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:594:10)
    at /Users/theo/.nvm/versions/node/v8.1.2/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:357:28
    at _fulfilled (/Users/theo/.nvm/versions/node/v8.1.2/lib/node_modules/cordova/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/Users/theo/.nvm/versions/node/v8.1.2/lib/node_modules/cordova/node_modules/q/q.js:816:30)

Here is the explanation : https://cordova.apache.org/announcements/2017/12/04/cordova-android-7.0.0.html

I'm not sure how to solve it though.

@dcleto
Copy link

dcleto commented Dec 24, 2017

Did you solve this?

@garygriswold
Copy link

garygriswold commented Dec 24, 2017 via email

@dcleto
Copy link

dcleto commented Dec 24, 2017

I solved this by removing one of the plugins "cordova-sqlite-storage"

@garygriswold
Copy link

I have figured out the problem. It is not a bug in the ionic-plugin-keyboard. I have submitted a bug on Cordova 7.1.0.

        Summary: AndroidStudio.js incorrectly decides project is Eclipse project
            Key: CB-13716
            URL: https://issues.apache.org/jira/browse/CB-13716

The problem occurs when you add a plugin that was created with Eclipse and then after that add a plugin created with Android Studio. I think it will work to simply add all Eclipse generated plugins last.

@snagarohit
Copy link

snagarohit commented Dec 28, 2017

Same issue here. I'm trying to rollback cordova android.

@snagarohit
Copy link

Okay, I can confirm going back to 6.3.0 fixes this. Looks like ionic plugins are not updated to look for the AndroidManifest.xml in the new path due to [email protected]

@mburger81
Copy link

@dwieeb can you have a look on this?
thx

@mburger81
Copy link

The problem seems, after installing cordova-sqlite-plugin using cordova-android 7.0.0 you can not install any other plugin anymore. You can see the bug here

storesafe/cordova-sqlite-storage#729

So don't use cordova 7.0.0 until this problem is resolved

@ph98
Copy link

ph98 commented Jan 21, 2018

i'm using cordova 8.0.0 and still have this problem :)

@bertcarremans
Copy link

Same for me too on cordova 8.0.0

@lucasbasquerotto
Copy link

lucasbasquerotto commented Jan 23, 2018

I uninstalled the cordova-sqlite-plugin plugin and installed it in the latest version (currently 2.2.0). That fixed this problem for me:

ionic cordova plugin remove cordova-sqlite-plugin
ionic cordova plugin add [email protected]

Update

The correct instructions are:

ionic cordova plugin remove cordova-sqlite-storage
ionic cordova plugin add [email protected]

From their changelogs:

Android-sqlite-native-driver NDK objects in JAR to resolve issue on cordova-android@7

@ph98 @bertcarremans I think they are talking about the cordova-android version (that seems the cause of this issue), not the cordova version.

@bertcarremans
Copy link

@lucasbasquerotto : ok, my cordova-android version is indeed 7.0.0. But when I try to re-install the cordova-sqlite-plugin as you mentioned above, I get the following error

(node:873) UnhandledPromiseRejectionWarning: CordovaError: Failed to fetch plugin [email protected] 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 ETARGET
npm ERR! notarget No matching version found for [email protected]
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

@lucasbasquerotto
Copy link

@bertcarremans I think I wrote the plugin name incorrectly. Try:

ionic cordova plugin remove cordova-sqlite-storage
ionic cordova plugin add [email protected]

@rodrigoreal
Copy link

I've tried this sqlite solution, but i'm still getting the error when i try to install the keyboard plugin, anyone had any success?

@cryptocoinserver
Copy link

https://cordova.apache.org/announcements/2017/12/04/cordova-android-7.0.0.html

the locations of files have changed
This may affect plugin.xml files and config.xml files that use edit-config,

I spotted multiple plugins beeing affected by this. Only option right now is waiting for plugin updates or working with version 6:
ionic cordova platform rm android && ionic cordova platform add android@6

@brodycj
Copy link

brodycj commented Jan 29, 2018

This issue is now resolved on cordova-sqlite-storage ref: storesafe/cordova-sqlite-storage#729

@bertcarremans
Copy link

I uninstalled and re-installed the cordova-sqlite-storage plugin with the following commands

ionic cordova plugin remove cordova-sqlite-storage
ionic cordova plugin add cordova-sqlite-storage

But when I then try to add the Android platform with sudo cordova platform add android --save I get the following errors. I'm getting a bit desparate on this...

Using cordova-fetch for cordova-android@^7.0.0
(node:1495) UnhandledPromiseRejectionWarning: CordovaError: 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: npm: Command failed with exit code 1 Error output:
Unable to save binary /Users/bertcarremans/Tuintalent/code/node_modules/node-sass/vendor/darwin-x64-59 : { Error: EACCES: permission denied, mkdir '/Users/bertcarremans/Tuintalent/code/node_modules/node-sass/vendor'
at Object.fs.mkdirSync (fs.js:905:18)
at sync (/Users/bertcarremans/Tuintalent/code/node_modules/mkdirp/index.js:71:13)
at Function.sync (/Users/bertcarremans/Tuintalent/code/node_modules/mkdirp/index.js:77:24)
at checkAndDownloadBinary (/Users/bertcarremans/Tuintalent/code/node_modules/node-sass/scripts/install.js:111:11)
at Object. (/Users/bertcarremans/Tuintalent/code/node_modules/node-sass/scripts/install.js:154:1)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
errno: -13,
code: 'EACCES',
syscall: 'mkdir',
path: '/Users/bertcarremans/Tuintalent/code/node_modules/node-sass/vendor' }
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/local/bin/node',
gyp verb cli '/Users/bertcarremans/Tuintalent/code/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb which succeeded python2 /Users/bertcarremans/anaconda2/bin/python2
gyp verb check python version /Users/bertcarremans/anaconda2/bin/python2 -c "import platform; print(platform.python_version());" returned: "2.7.12\n"
gyp verb get node dir no --target version specified, falling back to host node version: 9.4.0
gyp verb command install [ '9.4.0' ]
gyp verb install input version string "9.4.0"
gyp verb install installing version: 9.4.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 9.4.0
gyp verb build dir attempting to create "build" dir: /Users/bertcarremans/Tuintalent/code/node_modules/node-sass/build
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/bertcarremans/Tuintalent/code/node_modules/node-sass/build'
gyp ERR! System Darwin 16.7.0
gyp ERR! command "/usr/local/bin/node" "/Users/bertcarremans/Tuintalent/code/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/bertcarremans/Tuintalent/code/node_modules/node-sass
gyp ERR! node -v v9.4.0
gyp ERR! node-gyp -v v3.6.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.
npm WARN The package gulp is included as both a dev and production dependency.
npm WARN The package gulp-concat is included as both a dev and production dependency.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall 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/bertcarremans/.npm/_logs/2018-01-30T20_42_46_721Z-debug.log
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/platform/addHelper.js:312:25
at _rejected (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:797:24)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/q/q.js:823:30
at Promise.when (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:1142:31)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:808:41)
at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:624:44
at runSingle (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:137:13)
at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:125:13)
at process._tickCallback (internal/process/next_tick.js:150:11)
(node:1495) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1495) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@brodycj
Copy link

brodycj commented Jan 30, 2018

@bertcarremans it looks to me like there is something seriously wrong in your environment, which has nothing to do with cordova-sqlite-storage or this plugin. For one thing you should never have to use the sudo command when working on a Cordova project in your own environment. Also the first 3 lines of the output:

Using cordova-fetch for cordova-android@^7.0.0
(node:1495) UnhandledPromiseRejectionWarning: CordovaError: Failed to fetch platform cordova-android@^7.0.0
Probably this is either a connection problem, or platform spec is incorrect.

indicate something wrong with your Cordova CLI or Cordova environment.

I recommend that you completely remove the plugins and platforms directories, update to latest Cordova CLI version, remove all Cordova platforms from config.xml, remove all Cordova platforms from package.json if present, add all plugins with --save flag (--save is automatic starting with Cordova CLI 7.0), and then do cordova platform add android, without using sudo.

In case this does not work then I recommend that you start with a fresh, clean project, start with basic plugins on Android, and then try adding one plugin at a time (again without using sudo).

@DanFast
Copy link

DanFast commented Mar 3, 2018

I think the problem is that the plugin is deprecated.

Please use cordova-plugin-ionic-keyboard as mentioned on the github repository for the old plugin

This should fix it: https://github.com/ionic-team/cordova-plugin-ionic-keyboard

@erperejildo
Copy link

erperejildo commented Mar 8, 2018

We need version >7 if we want to use ads on our apps:
https://support.google.com/admob/answer/7562314?ctx=email

Roll back to version 6 is not a real fix I'm afraid.

@DanFast do we need to install that after adding latest version of android platform?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests