こんにちは、PhoneGap Android で作業しており、仮想デバイスと実際のデバイスの両方で Android 2.3.3 で動作するアプリをリリースしました。
ただし、仮想デバイスと実際のデバイスの両方で Android 4.1 を実行すると、アプリはアプリの最初のページを通過することさえありません。
すべてのコードを try ブロックに配置しましたが、どれもトリガーされず、アプリは古いバージョンでうまく機能するため、何が問題なのか途方に暮れています。
これは、Android 4.1 での私の logcat です。
10-14 22:48:53.502: I/CordovaLog(871): Changing log level to DEBUG(3)
10-14 22:48:53.502: I/CordovaLog(871): Found preference for useBrowserHistory=false
10-14 22:48:53.512: D/CordovaLog(871): Found preference for useBrowserHistory=false
10-14 22:48:53.562: D/JsMessageQueue(871): Set native->JS mode to 1
10-14 22:48:53.694: D/DroidGap(871): DroidGap.init()
10-14 22:48:53.822: D/CordovaWebView(871): DroidGap.loadUrl(file:///android_asset/www/splash.html, 10000)
10-14 22:48:53.822: D/DroidGap(871): onMessage(splashscreen,show)
10-14 22:48:54.202: D/dalvikvm(871): GC_FOR_ALLOC freed 87K, 3% free 8080K/8259K, paused 335ms, total 339ms
10-14 22:48:54.312: I/dalvikvm-heap(871): Grow heap (frag case) to 9.111MB for 1228816-byte allocation
10-14 22:48:54.522: D/dalvikvm(871): GC_FOR_ALLOC freed 1K, 3% free 9278K/9479K, paused 201ms, total 201ms
10-14 22:48:55.032: D/dalvikvm(871): GC_CONCURRENT freed 4K, 3% free 9283K/9479K, paused 102ms+77ms, total 440ms
10-14 22:48:56.101: D/CordovaWebView(871): >>> loadUrl(file:///android_asset/www/splash.html)
10-14 22:48:56.101: D/PluginManager(871): init()
10-14 22:48:56.141: D/CordovaWebView(871): >>> loadUrlNow()
10-14 22:48:56.141: D/DroidGap(871): Resuming the App
10-14 22:48:56.192: I/Choreographer(871): Skipped 33 frames! The application may be doing too much work on its main thread.
10-14 22:48:56.532: D/SoftKeyboardDetect(871): Ignore this event
10-14 22:48:56.802: I/Choreographer(871): Skipped 75 frames! The application may be doing too much work on its main thread.
10-14 22:48:56.973: D/gralloc_goldfish(871): Emulator without GPU emulation detected.
10-14 22:48:57.764: D/SoftKeyboardDetect(871): Ignore this event
10-14 22:48:59.602: D/DroidGap(871): onMessage(onPageStarted,file:///android_asset/www/splash.html)
10-14 22:49:06.772: D/SoftKeyboardDetect(871): Ignore this event
10-14 22:49:16.172: E/CordovaWebView(871): CordovaWebView: TIMEOUT ERROR!
10-14 22:49:16.172: D/Cordova(871): CordovaWebViewClient.onReceivedError: Error code=-6 Description=The connection to the server was unsuccessful. URL=file:///android_asset/www/splash.html
10-14 22:49:16.232: D/DroidGap(871): onMessage(onReceivedError,{"errorCode":-6,"url":"file:\/\/\/android_asset\/www\/splash.html","description":"The connection to the server was unsuccessful."})
10-14 22:49:16.764: I/Choreographer(871): Skipped 131 frames! The application may be doing too much work on its main thread.
10-14 22:49:16.764: D/SoftKeyboardDetect(871): Ignore this event
10-14 22:49:17.321: D/Cordova(871): onPageFinished(file:///android_asset/www/splash.html)
10-14 22:49:17.332: D/CordovaWebView(871): >>> loadUrlNow()
10-14 22:49:17.364: D/DroidGap(871): onMessage(onNativeReady,null)
10-14 22:49:17.364: D/DroidGap(871): onMessage(onPageFinished,file:///android_asset/www/splash.html)
10-14 22:49:17.386: I/Choreographer(871): Skipped 112 frames! The application may be doing too much work on its main thread.
10-14 22:49:49.262: D/DroidGap(871): Paused the application!
10-14 22:49:50.032: W/IInputConnectionWrapper(871): showStatusIcon on inactive InputConnection
10-14 22:49:51.446: D/DroidGap(871): onDestroy()
10-14 22:49:51.446: D/CordovaWebView(871): >>> loadUrlNow()
10-14 22:49:51.472: D/CordovaWebView(871): >>> loadUrlNow()
10-14 22:49:51.642: D/DroidGap(871): onMessage(onPageStarted,about:blank)
10-14 22:49:51.682: W/System.err(871): java.net.SocketException: Socket closed
10-14 22:49:51.682: W/System.err(871): at libcore.io.Posix.accept(Native Method)
10-14 22:49:51.702: W/System.err(871): at libcore.io.BlockGuardOs.accept(BlockGuardOs.java:55)
10-14 22:49:51.702: W/System.err(871): at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:98)
10-14 22:49:51.702: W/System.err(871): at java.net.ServerSocket.implAccept(ServerSocket.java:202)
10-14 22:49:51.702: W/System.err(871): at java.net.ServerSocket.accept(ServerSocket.java:127)
10-14 22:49:51.702: W/System.err(871): at org.apache.cordova.CallbackServer.run(CallbackServer.java:195)
10-14 22:49:51.702: W/System.err(871): at java.lang.Thread.run(Thread.java:856)
10-14 22:49:52.302: D/Cordova(871): onPageFinished(about:blank)
10-14 22:49:52.312: D/DroidGap(871): onMessage(onPageFinished,about:blank)
10-14 22:49:52.312: D/DroidGap(871): onMessage(exit,null)
どんな助けでも大歓迎です。
ありがとうございました。
編集:
私は PhoneGap バージョンを使用しています: cordova-2.1.0.js
さらに読んで、この行を MainActivity.java に追加しました
super.setIntegerProperty("loadUrlTimeoutValue", 60000);
また、ADB 接続タイムアウトを 5000 から 10000 に変更しました
ここに私のマニフェストファイルがあります
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.game.demo"
android:versionCode="2"
android:versionName="1.1" >
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="15" />
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:resizeable="true"
android:anyDensity="true" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale"
android:name=".MainActivity"
android:label="@string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>