Tools for Apache Cordova - Installed Plugins are skipped in build

孤街醉人 提交于 2019-12-25 04:31:34

问题


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.

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:


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.



来源:https://stackoverflow.com/questions/30698118/tools-for-apache-cordova-installed-plugins-are-skipped-in-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!