ionic-team / ionic-plugin-keyboard

Ionic Keyboard Plugin for Cordova
Apache License 2.0
611 stars 278 forks source link

Not compatible with cordova-android 7.0.0 #304

Open Mokto opened 6 years ago

Mokto commented 6 years ago

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 commented 6 years ago

Did you solve this?

garygriswold commented 6 years ago

No

Sent from my iPhone

On Dec 24, 2017, at 7:29 AM, dcleto notifications@github.com wrote:

Did you solve this?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

dcleto commented 6 years ago

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

garygriswold commented 6 years ago

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 commented 6 years ago

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

snagarohit commented 6 years ago

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 cordova-android@7.0.0

mburger81 commented 6 years ago

@dwieeb can you have a look on this? thx

mburger81 commented 6 years ago

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

https://github.com/litehelpers/Cordova-sqlite-storage/issues/729

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

ph98 commented 6 years ago

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

bertcarremans commented 6 years ago

Same for me too on cordova 8.0.0

lucasbasquerotto commented 6 years ago

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 cordova-sqlite-plugin@2.2.0

Update

The correct instructions are:

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

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 commented 6 years ago

@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 cordova-sqlite-plugin@2.2.0 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 cordova-sqlite-plugin@2.2.0 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 commented 6 years ago

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

ionic cordova plugin remove cordova-sqlite-storage
ionic cordova plugin add cordova-sqlite-storage@2.2.0
rodrigoreal commented 6 years ago

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 commented 6 years ago

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

brodybits commented 6 years ago

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

bertcarremans commented 6 years ago

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 node-gyp@3.6.0 gyp info using node@9.4.0 | 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 tuintalent@1.1.1 No repository field. npm WARN tuintalent@1.1.1 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! node-sass@3.13.1 postinstall: node scripts/build.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the node-sass@3.13.1 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.

brodybits commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

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?