Tools for Apache Cordova - Installed Plugins are skipped in build

558 views Asked by At

i have a cordova app with 6 plugins and the strange behavior that app is not working after i create a new clone of the sources from github.

If i install a plugin over the config.xml dialog and build the android version of the app. The native source file (*.java) of the app is copied into

App\platforms\android\src\org\apache\cordova\camera\CameraLauncher.java

The app runs on the dev device where i added the plugin to the project. But if i upload my changes (config.xml, app/plugins folder) to github and clone the project on a different dev machine. The App will not run on a device or emulator and i get the following error.

enter image description here

If i look into the platforms folder after the build. I detected that the plugin.java files are not there! There was only one java file in the folder

App\platforms\android\src...\MainActivity.java

A workaround is to delete all installed plugins and reinstall them again. The Error exists not only for android. In the Windows Phone platforms folder
is every Plugin.cs file missing, like the App\platforms\wp8\Plugins\org.apache.cordova.camera\Camera.cs.

Where is the location of the file/config that must be checkedin to remember the installed plugins? I read sometimes the name "plugman", is this the right direction?

Regards

1

There are 1 answers

2
Chuck Lantz On BEST ANSWER

As it turns out, you should not check in the "android.json", "remote_ios.json","windows.json", and "wp8.json" from the plugins "folder" or this problem can happen (though fetch.json is fine). Unfortunately they are missing from the default exclusion list for Cordova projects in VS 2015 RC.

To fix, add these four files to a .gitignore file in your project (one is likely at the solution root), delete them from the source repo, and re-clone and everything should work for you.