Skip to content

Error while doing "cordova platform add android"Β #130

@Doomkyn

Description

@Doomkyn

Hi, I'm trying this plugin and while the iOS platform gets compiled correctly, when I try to add the android platform, I get this error:

PS C:\Users\Kevin\Desktop\BarcodeTest> cordova platform add android
Using cordova-fetch for cordova-android@~7.0.0
Adding android project...
Creating Cordova project for the Android platform:
        Path: platforms\android
        Package: it.nowhere.barcodetest
        Name: BarcodeTest
        Activity: MainActivity
        Android target: android-26
Subproject Path: CordovaLib
Subproject Path: app
Android project created with [email protected]
Android Studio project detected
Android Studio project detected
Installing "cordova-plugin-cszbar" for android
Subproject Path: CordovaLib
Subproject Path: app
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" for android
Failed to install 'cordova-plugin-whitelist': Error: ENOENT: no such file or directory, open 'C:\Users\Kevin\Desktop\BarcodeTest\platforms\android\AndroidManifest.xml'
    at Object.fs.openSync (fs.js:584:18)
    at Object.fs.readFileSync (fs.js:491:33)
    at Object.parseElementtreeSync (C:\Users\Kevin\Desktop\BarcodeTest\platforms\android\cordova\node_modules\cordova-common\src\util\xml-helpers.js:180:27)
    at new AndroidManifest (C:\Users\Kevin\Desktop\BarcodeTest\platforms\android\cordova\lib\AndroidManifest.js:29:20)
    at AndroidProject.getPackageName (C:\Users\Kevin\Desktop\BarcodeTest\platforms\android\cordova\lib\AndroidProject.js:99:12)
    at Api.addPlugin (C:\Users\Kevin\Desktop\BarcodeTest\platforms\android\cordova\Api.js:223:57)
    at handleInstall (C:\Users\Kevin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:594:10)
    at C:\Users\Kevin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:357:28
    at _fulfilled (C:\Users\Kevin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\q\q.js:787:54)
    at self.promiseDispatch.done (C:\Users\Kevin\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\q\q.js:816:30)
Failed to restore plugin "cordova-plugin-whitelist" from config.xml. You might need to try adding it again. Error: Error: ENOENT: no such file or directory, open 'C:\Users\Kevin\Desktop\BarcodeTest\platforms\android\AndroidManifest.xml'
--save flag or autosave detected
Saving android@~7.0.0 into config.xml file ...

Even if this seems a problem not releated to the plugin, in the end it is, cause if I try every other plugin the platform is added without errors.
Anyone managed to solve this?
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions