2

I've developed a custom plugin for a cordova application and trying to test it out with the latest cordova Android platform version.

Whenever I run:

cordova plugin add ../my-plugin
cordova platform add android

or

cordova platform add android
cordova plugin add ../my-plugin

I get the following error:

Failed to install 'com.my.plugin': Error: ENOENT: no such file or directory, open '/path/to/project/my-application/platforms/android/AndroidManifest.xml'

This is the content of my plugin.xml file for what concerns the AndroidManifest.xml.

<config-file target="app/src/main/AndroidManifest.xml" parent="/*">
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <uses-permission android:name="android.permission.INTERNET"/>
</config-file>

I've already seen this answer which is pretty commonly shared throughout different resources and websites I visited but is not helping me since I'm already using app/src/main/AndroidManifest.xml after updating from android@6.4.0 to android@7.0.0.


My environment is:

  • macOS
  • cordova@8.1.2
  • android@7.1.1

Note: As of now I made it work by using android@6.4.0 but I'd like to understand how to make it work with newer platform versions.

fredmaggiowski
  • 2,232
  • 3
  • 25
  • 44

0 Answers0