Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-13830

Cordova-Android@7.0.0 fails to add a plugin previously removed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • cordova-android-7.0.0
    • None
    • cordova-android
    • None
    • macOS 10.12.6

      node 9.4.0

      Cordova CLI 8.0.0

       

    Description

      Removing a plugin and than adding it again, causes an error:

      $ cordova create testapp
      
      $ cd testapp
      
      $ 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: io.cordova.hellocordova
       Name: HelloCordova
       Activity: MainActivity
       Android target: android-26
      Subproject Path: CordovaLib
      Subproject Path: app
      Android project created with cordova-android@7.0.0
      Android Studio project detected
      Android Studio project detected
      Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
      Installing "cordova-plugin-whitelist" for android
      
      This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
       
      Adding cordova-plugin-whitelist to package.json
      Saved plugin info for "cordova-plugin-whitelist" to config.xml
      --save flag or autosave detected
      Saving android@~7.0.0 into config.xml file ...
      
      $ cordova plugin add cordova-plugin-camera
      Installing "cordova-plugin-camera" for android
      Android Studio project detected
      Subproject Path: CordovaLib
      Subproject Path: app
      Adding cordova-plugin-camera to package.json
      Saved plugin info for "cordova-plugin-camera" to config.xml
      
      $ cordova plugin remove cordova-plugin-camera
      Uninstalling cordova-plugin-camera from android
      Android Studio project detected
      Subproject Path: CordovaLib
      Subproject Path: app
      Removing "cordova-plugin-camera"
      Removing plugin cordova-plugin-camera from config.xml file...
      Removing cordova-plugin-camera from package.json
      
      $ cordova plugin add cordova-plugin-camera
      Installing "cordova-plugin-camera" for android
      Android Studio project detected
      Error during processing of action! Attempting to revert...
      Failed to install 'cordova-plugin-camera': CordovaError: Uh oh!
      "/Users/enrico/tmp/testapp/platforms/android/app/src/main/res/xml/provider_paths.xml" already exists!
       at copyNewFile (/Users/enrico/tmp/testapp/platforms/android/cordova/lib/pluginHandlers.js:261:45)
       at install (/Users/enrico/tmp/testapp/platforms/android/cordova/lib/pluginHandlers.js:51:17)
       at ActionStack.process (/Users/enrico/tmp/testapp/platforms/android/cordova/node_modules/cordova-common/src/ActionStack.js:56:25)
       at PluginManager.doOperation (/Users/enrico/tmp/testapp/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js:114:20)
       at PluginManager.addPlugin (/Users/enrico/tmp/testapp/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js:144:17)
       at /Users/enrico/tmp/testapp/platforms/android/cordova/Api.js:247:74
       at _fulfilled (/Users/enrico/tmp/testapp/platforms/android/cordova/node_modules/q/q.js:854:54)
       at self.promiseDispatch.done (/Users/enrico/tmp/testapp/platforms/android/cordova/node_modules/q/q.js:883:30)
       at Promise.promise.promiseDispatch (/Users/enrico/tmp/testapp/platforms/android/cordova/node_modules/q/q.js:816:13)
       at /Users/enrico/tmp/testapp/platforms/android/cordova/node_modules/q/q.js:570:49
      (node:5722) UnhandledPromiseRejectionWarning: CordovaError: Uh oh!
      "/Users/enrico/tmp/testapp/platforms/android/app/src/main/res/xml/provider_paths.xml" already exists!
       at copyNewFile (/Users/enrico/tmp/testapp/platforms/android/cordova/lib/pluginHandlers.js:261:45)
       at install (/Users/enrico/tmp/testapp/platforms/android/cordova/lib/pluginHandlers.js:51:17)
       at ActionStack.process (/Users/enrico/tmp/testapp/platforms/android/cordova/node_modules/cordova-common/src/ActionStack.js:56:25)
       at PluginManager.doOperation (/Users/enrico/tmp/testapp/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js:114:20)
       at PluginManager.addPlugin (/Users/enrico/tmp/testapp/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js:144:17)
       at /Users/enrico/tmp/testapp/platforms/android/cordova/Api.js:247:74
       at _fulfilled (/Users/enrico/tmp/testapp/platforms/android/cordova/node_modules/q/q.js:854:54)
       at self.promiseDispatch.done (/Users/enrico/tmp/testapp/platforms/android/cordova/node_modules/q/q.js:883:30)
       at Promise.promise.promiseDispatch (/Users/enrico/tmp/testapp/platforms/android/cordova/node_modules/q/q.js:816:13)
       at /Users/enrico/tmp/testapp/platforms/android/cordova/node_modules/q/q.js:570:49
      (node:5722) 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:5722) [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.
      

       

      Attachments

        Issue Links

          Activity

            People

              bowserj Joey Robert Bowser
              enricogior Enrico Giordani
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: