简体   繁体   中英

Cordova failed to install 'cordova-plugin-whitelist': Error: ENOENT: no such file or directory AndroidManifest.xml

I have Cordova 8.0.0 on OSx 10.13.2 with Node v8.5.0 and npm v5.5.1.

After adding plugin cordova-plugin-ibeacon , when I do a cordova platform add android , I am getting following error:

failed to install 'cordova-plugin-whitelist': Error: ENOENT: no such file or directory AndroidManifest.xml

Screenshot:

截图

You are using cordova-android@~7.0.0

I have faced same issues with recent pull of cordova-android repo with Cordova 8.0.0

Downgrade cordova-android to 6.4.0 as follows:

cordova platform remove android
cordova platform add android@6.4.0

This is a bit late. But sharing some personal observations when I encountered similar issues.

The build process fails if there is an old plugin that is not updated to work with the platform@7.0.0 . At least this is the case for me. After installing this incompatible plugin, it would mess up the files in platform. After which trying to salvage the project by removing the plugin would also fail, because the files would have been put in the wrong directories when installing. You would have to remove the platform "cordova platform rm " followed by the misbehaving plugin "cordova plugin rm " and re-add back your platform before the the build can fixed.

Why android@6.30 and android@6.4.0 may work is because it is probably using the older platform project directory layout, where it appeared to use the top level /platforms/android directory for 'res' and 'libs' folder.

From android@7.0.0 onward, I notice it added the 'app' subdirectory, and your 'config.xml' and 'res' are expected at '/platforms/android/app/src/main/res/xml/config.xml' and not '/platforms/android/res/xml/config.xml'.

Older plugin may have installation/removal scripts that copy the files to the wrong places.

The only 2 ways to fix this problem is to update the plugin or downgrade the platform as suggested by Bharat Biswal.

If anyone has a more definite answer, that would be great.

You are using cordova 7.0.0 or cordova 8.0.0, similar issue is observed with IONIC as well

You will find this issues with most of the plugins such as admobpro, admob, itablet, whitelist etc.

Better for now roll back to previous cordova version ie 6.3.0 or 6.4.0

If you see mentioned issues with any of plugins try this.

cordova platform remove android
cordova platform add android@6.3.0 

OR

cordova platform remove android
cordova platform add android@6.4.0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM