PhoneGap的3.1构建设备没有定义 [英] PhoneGap 3.1 Build Device Is Not Defined
问题描述
我有煎茶触摸项目。我建立与PhoneGap的2.9和工作正常device.uuid返回设备ID。当我试图构建与3.1 device.uuid抛出设备没有定义的错误。 我的config.xml
I have a sencha touch project. I was build with phonegap 2.9 and works fine device.uuid returning to device Id. When I tried the build with 3.1 device.uuid throwing " Device Is Not Defined" error. My config.xml
<preference name="phonegap-version" value="3.1.0" />
<preference name="stay-in-webview" value="true" />
<access origin="*" />
<gap:plugin name="com.phonegap.plugins.barcodescanner" />
<gap:splash src="images/splash.png" />
<feature name="http://api.phonegap.com/1.0/camera" />
<feature name="Device">
<param name="android-package" value="org.apache.cordova.device.Device" />
</feature>
我的设备ID请求:
My Device ID request:
try
{
Ext.getCmp('txtUUID').setValue(device.uuid);
}
catch(err)
{alert(err);
Ext.getCmp('txtUUID').setValue('ID Okunamadı!');
}
我需要帮助。如何解决这个问题呢?
I need help. How to resolve this problem ?
推荐答案
我假设你正在与PhoneGap的构建,对吧?
I assume you are building with phonegap build, right?
在PhoneGap的3,核心API没有更多的包括默认,现在的插件,所以你必须明确添加您正在使用的所有API。
In phonegap 3, the core api are no more included by default and are now plugins, so you have to explicitly add any api you are using.
您应该能够添加以下行后的config.xml读UUID:
You should be able to read the UUID after adding the following line to config.xml :
<gap:plugin name="org.apache.cordova.device" />
你也可以删除下列行,因为API功能是通过新的插件格式,目前处理的。
And you can also remove the following lines since the API features are now handled by the new plugin format.
没用行:
<feature name="http://api.phonegap.com/1.0/camera" />
<feature name="Device">
<param name="android-package" value="org.apache.cordova.device.Device" />
</feature>
这篇关于PhoneGap的3.1构建设备没有定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!