Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/386.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript phonegap/cordova onDeviceReady()未启动android 4.1.2_Javascript_Android_Cordova - Fatal编程技术网

Javascript phonegap/cordova onDeviceReady()未启动android 4.1.2

Javascript phonegap/cordova onDeviceReady()未启动android 4.1.2,javascript,android,cordova,Javascript,Android,Cordova,我在这里束手无策。我使用的是Adobe Build和PhoneGap版本3.5.0以及Cordova 3.4.0 无论我做什么,我的onDeviceReady事件都不会在我的android设备上启动,无论是作为APK还是PhoneGap开发者应用程序 以下是我的config.xml: <?xml version='1.0' encoding='utf-8'?> <widget id="com.phonegap.ourwalmart" version="1.0.0" xmlns=

我在这里束手无策。我使用的是Adobe Build和PhoneGap版本3.5.0以及Cordova 3.4.0

无论我做什么,我的onDeviceReady事件都不会在我的android设备上启动,无论是作为APK还是PhoneGap开发者应用程序

以下是我的config.xml:

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.phonegap.ourwalmart" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
  <name>xxxx</name>
  <description>
xxxx  </description>
  <author email="xx@xxx.org" href="http://xxxxxxx.org">
    OUR Walmart
  </author>
  <preference name="permissions" value="none" />
  <preference name="phonegap-version" value="3.5.0" />
  <preference name="orientation" value="default" />
  <preference name="target-device" value="universal" />
  <preference name="fullscreen" value="true" />
  <preference name="webviewbounce" value="false" />
  <preference name="prerendered-icon" value="true" />
  <preference name="stay-in-webview" value="false" />
  <!--<preference name="ios-statusbarstyle" value="black-translucent" />-->
  <preference name="detect-data-types" value="true" />
  <preference name="exit-on-suspend" value="false" />
  <!--<preference name="show-splash-screen-spinner" value="true" />
  <preference name="auto-hide-splash-screen" value="true" />-->
  <preference name="disable-cursor" value="false" />
  <preference name="android-minSdkVersion" value="7" />
  <preference name="android-installLocation" value="auto" />
  <gap:plugin name="com.phonegap.plugin.statusbar" />
  <gap:plugin name="org.apache.cordova.battery-status" />
  <gap:plugin name="org.apache.cordova.camera" />
  <gap:plugin name="org.apache.cordova.media-capture" />
  <gap:plugin name="org.apache.cordova.console" />
  <gap:plugin name="org.apache.cordova.contacts" />
  <gap:plugin name="org.apache.cordova.device" />
  <gap:plugin name="org.apache.cordova.device-motion" />
  <gap:plugin name="org.apache.cordova.device-orientation" />
  <gap:plugin name="org.apache.cordova.dialogs" />
  <gap:plugin name="org.apache.cordova.file" />
  <gap:plugin name="org.apache.cordova.file-transfer" />
  <gap:plugin name="org.apache.cordova.geolocation" />
  <gap:plugin name="org.apache.cordova.globalization" />
  <gap:plugin name="org.apache.cordova.inappbrowser" />
  <gap:plugin name="org.apache.cordova.media" />
  <gap:plugin name="org.apache.cordova.network-information" />
  <gap:plugin name="org.apache.cordova.splashscreen" />
  <gap:plugin name="org.apache.cordova.vibration" />
  <icon src="icon.png" />
   <icon gap:platform="android" gap:qualifier="ldpi" src="res/icon/android/icon-36-ldpi.png" />
    <icon gap:platform="android" gap:qualifier="mdpi" src="res/icon/android/icon-48-mdpi.png" />
    <icon gap:platform="android" gap:qualifier="hdpi" src="res/icon/android/icon-72-hdpi.png" />
    <icon gap:platform="android" gap:qualifier="xhdpi" src="res/icon/android/icon-96-xhdpi.png" />
    <icon gap:platform="blackberry" src="res/icon/blackberry/icon-80.png" />
    <icon gap:platform="blackberry" gap:state="hover" src="res/icon/blackberry/icon-80.png" />
    <icon gap:platform="ios" height="57" src="res/icon/ios/icon-57.png" width="57" />
    <icon gap:platform="ios" height="72" src="res/icon/ios/icon-72.png" width="72" />
    <icon gap:platform="ios" height="114" src="res/icon/ios/icon-57-2x.png" width="114" />
    <icon gap:platform="ios" height="144" src="res/icon/ios/icon-72-2x.png" width="144" />
    <icon gap:platform="webos" src="res/icon/webos/icon-64.png" />
    <icon gap:platform="winphone" src="res/icon/windows-phone/icon-48.png" />
    <icon gap:platform="winphone" gap:role="background" src="res/icon/windows-phone/icon-173.png" /> 
  <gap:splash gap:platform="android" gap:qualifier="port-ldpi" src="res/screen/android/screen-ldpi-portrait.png" />
  <gap:splash gap:platform="android" gap:qualifier="port-mdpi" src="res/screen/android/screen-mdpi-portrait.png" />
  <gap:splash gap:platform="android" gap:qualifier="port-hdpi" src="res/screen/android/screen-hdpi-portrait.png" />
  <gap:splash gap:platform="android" gap:qualifier="port-xhdpi" src="res/screen/android/screen-xhdpi-portrait.png" />
  <gap:splash gap:platform="blackberry" src="res/screen/blackberry/screen-225.png" />
  <gap:splash gap:platform="ios" height="480" src="res/screen/ios/screen-iphone-portrait.png" width="320" />
  <gap:splash gap:platform="ios" height="960" src="res/screen/ios/screen-iphone-portrait-2x.png" width="640" />
  <gap:splash gap:platform="ios" height="1136" src="res/screen/ios/screen-iphone-portrait-568h-2x.png" width="640" />
  <gap:splash gap:platform="ios" height="1024" src="res/screen/ios/screen-ipad-portrait.png" width="768" />
  <gap:splash gap:platform="ios" height="768" src="res/screen/ios/screen-ipad-landscape.png" width="1024" />
  <gap:splash gap:platform="winphone" src="res/screen/windows-phone/screen-portrait.jpg" />
  <access origin="*" />

</widget>
在页眉中调用app.initialize不能保证页面已就绪。尝试将其添加到正文的onload属性:

<body onload="app.initialize()">

很抱歉发布了这个。事实证明,在我的一个JS文件中,我包含了这一行

window._cordovaNative = true;
这意味着我测试的旧款三星Galaxy II不会进入提示模式。如果其他人遇到此问题,请检查以确保代码中没有这一行


它对于在浏览器上调试很有用,但会关闭旧手机的应用程序。

我在index.html中没有看到index.js。检查控制台是否有错误,index.js丢失&删除phonegap或cordova。只有一个就够了
<body onload="app.initialize()">
window._cordovaNative = true;