适用于Apache Cordova的工具-在构建过程中会跳过已安装的插件 [英] Tools for Apache Cordova - Installed Plugins are skipped in build

查看:88
本文介绍了适用于Apache Cordova的工具-在构建过程中会跳过已安装的插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有6个插件的cordova应用,在我从github创建了一个新的源克隆之后,该应用无法正常工作的奇怪行为.

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.

如果我通过config.xml对话框安装插件并构建该应用程序的android版本.该应用程序的本机源文件(* .java)已复制到

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

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

该应用程序在将插件添加到项目的dev设备上运行. 但是,如果我将更改(config.xml,app/plugins文件夹)上传到github并在另一台开发机上克隆该项目.该应用程序无法在设备或仿真器上运行,并且出现以下错误.

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.

如果我在构建后查看Platforms文件夹.我检测到plugin.java文件不存在!文件夹中只有一个Java文件

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

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

一种解决方法是删除所有已安装的插件,然后再次重新安装它们. 该错误不仅存在于android中.在Windows Phone平台文件夹中
是否缺少每个Plugin.cs文件,例如App \ platforms \ wp8 \ Plugins \ org.apache.cordova.camera \ Camera.cs.

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.

必须记住文件/配置的位置在哪里以记住已安装的插件?我有时读过"plugman"这个名字,这是正确的方向吗?

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?

致谢

推荐答案

事实证明,您不应签入"android.json","remote_ios.json","windows.json"和"wp8".插件"文件夹中的json",否则可能会发生此问题(尽管fetch.json没问题).不幸的是,在VS 2015 RC中,Cordova项目的默认排除列表中缺少它们.

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.

要解决此问题,请将这四个文件添加到项目中的.gitignore文件中(一个可能在解决方案的根目录中),将其从源存储库中删除,然后重新克隆,一切都将对您有用.

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.

这篇关于适用于Apache Cordova的工具-在构建过程中会跳过已安装的插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆