我使用 zxing 插件创建了一个 qrcode 扫描仪它适用于模拟器。但是现在我不知道要为同一个版本创建一个构建.我已经在我的config.xml文件中包含了以下行
<plugins name="BarcodeScanner" value="com.phonegap.plugins.barcodescanner.BarcodeScanner"/>
我还需要创建插件.xml
PhoneGap 构建不支持"随心所欲"的插件。仅支持一个插件。
因此,您不能将PhoneGap构建与插件一起使用。
您正在通过自己设置开发环境并使用您的计算机进行构建/签名来创建此应用程序。
我使用 http://build.phonegap.com 很快就取得了成功 - 不要太快注销!它有那个插件(条形码),我所要做的就是在我的项目的根目录中创建一个配置.xml具有:
<!-- phonegap build config.xml syntax -->
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns = "http://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
id = "com.phonegap.xxx-xxx"
version = "3.0.1">
<name>Web Remote</name>
<description>
WebRemote Application
</description>
<!-- more info here-->
<gap:plugin name="BarcodeScanner" /> <!-- use latest release by default -->
</widget>
请参阅<gap:plugin>?
这就是我在phonegab构建中要做的就是告诉它使用BarcodeScanner插件编译我的应用程序。我试过了,它有效!这是一种美。不,这不是您在本机编译中执行此操作的方式,因为您自己构建它,请确保您的脑海中有 ',因为您的应用程序需要能够与本机插件通信(如果使用 iOS,则 https://github.com/phonegap/phonegap-plugins/blob/master/iPhone/BarcodeScanner/barcodescanner.js)。
顺便说一句 - 你没有提到你正在为哪个平台(iOS 等)构建,所以我只是假设 iOS。