Phonegap 3 doesn't copy plugins to platforms folder

10,414

Solution 1

It is fixed now, the issue was that add plugin command adds to plugin files to platforms project too, so the build command not copying these files during the build phase, so all I had to do is to remove plugins/ folder content and platforms/ content then I did those steps:

  • phonegap local build android
  • phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git

After all the add plugins commands should run only after all your platforms are added.

For more information kindly check this

Solution 2

I ran into the same issue building an iOS app. I've discovered that you won't have this issue if your project name starts with an uppercase letter. As long as the project name starts with an uppercase letter when you create it, you will be able to add plugins later.

Solution 3

I had a similar problem, I found I had to add all the plugins before I created a build.

Solution 4

I have to add a third party plugin(barcode) for a project, so i dupliqued other project and removed the folder Android, and then execute "cordova add platform android", but fails with cordova class not found, or another error for the plugin... so i list the plugins with cordova command, and saw all the plugins ok... so? why?.

The error is remove from explorer or manually... you have to delete from command line..

This was my solution.. and don´t have to re-add all the plugins... just

"cordova platform remove android"
"cordova platform add android" 

and the "android/src/" folder gets populated as "android/bin/classes".. sound strange but works...

you will note that the results for command lines change for a plugin... example..

cordova platform add android
Creating android project...
Preparing android project
Starting installation of "cordova-plugin-barcodescanner" for android
Preparing android project
cordova-plugin-barcodescanner installed on android.

Cordova Versión 3.3

Share:
10,414

Related videos on Youtube

Hazem Hagrass
Author by

Hazem Hagrass

Currently a technical manager @EDGY Specialties: JavaScript, Node.js, PHP, JS, Android, Phonegap, ReactNative

Updated on September 16, 2022

Comments

  • Hazem Hagrass
    Hazem Hagrass over 1 year

    I'm using Phonegap3 http://phonegap.com/install/ but I'm facing an issue with plugins:

    After creating project using

    phonegap create my-app

    phonegap local build android
    

    then I added a camera plugin using

    phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git
    

    http://docs.phonegap.com/en/edge/cordova_camera_camera.md.html#Camera

    then build project using phonegap local build android

    it was working fine but suddenly it stopped working, after investgating the issue I found that plugins are not copied to the android project although I can list all plugins using

    phonegap local plugin list
    
  • EthanZ
    EthanZ over 10 years
    does anyone know if phonegap team will fix this bug?