完全に機能する完全なphonegapアプリがいくつかあります。アクセスできるデバイスのセット全体を試してみましたが、GalaxyNoteでは実行されません。これはまったく新しいデバイスで、ネイティブアプリを実行できますが、phonegapアプリを実行すると黒い画面が表示され、アプリが閉じます。クラッシュもアラートも何もありません。
(関連性がなかったため、ここでログを削除します)
編集
問題を追跡しましたが、向きが変わると機能します。アクティビティを開始するとすぐに、向きが縦向きに設定されます。
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
そこで、そのレーンを削除し、デバイスを回転させたときに向きを変更するオプションをアクティブにしました。これで、アプリを起動すると実行されますが、回転させるとクラッシュします。理由がわかりません。jsコードにいくつかのアラートがあり、いずれも起動されません。興味深いのは、デバイスを回転させると、cordovaのデフォルトアプリもクラッシュすることです。以下に両方のログがあります。
これを修正する方法について何か提案はありますか?
DroidgapExampleログ:
11-27 12:41:15.750: D/DroidGap(9129): Paused the application!
11-27 12:41:15.750: D/CordovaWebView(9129): Handle the pause
11-27 12:41:15.750: D/CordovaWebView(9129): >>> loadUrlNow()
11-27 12:41:15.750: D/webkit(9129): Firewall not null
11-27 12:41:15.750: D/webkit(9129): euler: isUrlBlocked = false
11-27 12:41:15.760: D/DroidGap(9129): onDestroy()
11-27 12:41:15.760: D/CordovaWebView(9129): >>> loadUrlNow()
11-27 12:41:15.760: D/webkit(9129): Firewall not null
11-27 12:41:15.765: D/webkit(9129): euler: isUrlBlocked = false
11-27 12:41:15.765: D/CordovaWebView(9129): >>> loadUrlNow()
11-27 12:41:15.765: D/webkit(9129): Firewall not null
11-27 12:41:15.765: D/webkit(9129): euler: isUrlBlocked = false
11-27 12:41:15.775: D/DroidGap(9129): DroidGap.onCreate()
11-27 12:41:15.780: I/webclipboard(9129): clipservice: android.sec.clipboard.ClipboardExManager@4149bc80
11-27 12:41:15.785: D/CordovaWebView(9129): Origin to allow: http://127.0.0.1*
11-27 12:41:15.785: D/CordovaWebView(9129): Origin to allow: .*
11-27 12:41:15.785: I/CordovaLog(9129): Found log level DEBUG
11-27 12:41:15.785: I/CordovaLog(9129): Changing log level to DEBUG(3)
11-27 12:41:15.785: I/CordovaLog(9129): Found preference for useBrowserHistory=false
11-27 12:41:15.785: D/CordovaLog(9129): Found preference for useBrowserHistory=false
11-27 12:41:15.785: I/CordovaLog(9129): Found preference for exit-on-suspend=false
11-27 12:41:15.785: D/CordovaLog(9129): Found preference for exit-on-suspend=false
11-27 12:41:15.785: D/JsMessageQueue(9129): Set native->JS mode to 1
11-27 12:41:15.785: D/DroidGap(9129): DroidGap.init()
11-27 12:41:15.790: D/CordovaWebView(9129): >>> loadUrl(file:///android_asset/www/index.html)
11-27 12:41:15.790: D/PluginManager(9129): init()
11-27 12:41:15.795: D/CordovaWebView(9129): >>> loadUrlNow()
11-27 12:41:15.800: D/DroidGap(9129): Resuming the App
11-27 12:41:15.800: D/CordovaLog(9129): JSCallback Error: Request failed with status 0
11-27 12:41:15.800: D/CordovaLog(9129): file:///android_asset/www/cordova-2.1.0.js: Line 3743 : JSCallback Error: Request failed with status 0
11-27 12:41:15.800: I/Web Console(9129): JSCallback Error: Request failed with status 0 at file:///android_asset/www/cordova-2.1.0.js:3743
11-27 12:41:15.800: D/JsMessageQueue(9129): Set native->JS mode to 0
11-27 12:41:15.800: D/WML_SISO(9129): InitPasteboardJni
11-27 12:41:15.805: D/SoftKeyboardDetect(9129): Ignore this event
11-27 12:41:15.810: D/SoftKeyboardDetect(9129): Ignore this event
11-27 12:41:15.810: D/JsMessageQueue(9129): Set native->JS mode to 1
11-27 12:41:15.810: D/DroidGap(9129): onMessage(onPageStarted,about:blank)
11-27 12:41:15.820: W/webcore(9129): java.lang.Throwable: EventHub.removeMessages(int what = 107) is not supported before the WebViewCore is set up.
11-27 12:41:15.820: W/webcore(9129): at android.webkit.WebViewCore$EventHub.removeMessages(WebViewCore.java:2681)
11-27 12:41:15.820: W/webcore(9129): at android.webkit.WebViewCore$EventHub.access$13000(WebViewCore.java:1365)
11-27 12:41:15.820: W/webcore(9129): at android.webkit.WebViewCore.removeMessages(WebViewCore.java:2793)
11-27 12:41:15.820: W/webcore(9129): at android.webkit.WebView.sendOurVisibleRect(WebView.java:4046)
11-27 12:41:15.820: W/webcore(9129): at android.webkit.ZoomManager.setZoomScale(ZoomManager.java:1024)
11-27 12:41:15.820: W/webcore(9129): at android.webkit.ZoomManager.access$2100(ZoomManager.java:57)
11-27 12:41:15.820: W/webcore(9129): at android.webkit.ZoomManager$PostScale.run(ZoomManager.java:1595)
11-27 12:41:15.820: W/webcore(9129): at android.os.Handler.handleCallback(Handler.java:605)
11-27 12:41:15.820: W/webcore(9129): at android.os.Handler.dispatchMessage(Handler.java:92)
11-27 12:41:15.820: W/webcore(9129): at android.os.Looper.loop(Looper.java:137)
11-27 12:41:15.820: W/webcore(9129): at android.app.ActivityThread.main(ActivityThread.java:4517)
11-27 12:41:15.820: W/webcore(9129): at java.lang.reflect.Method.invokeNative(Native Method)
11-27 12:41:15.820: W/webcore(9129): at java.lang.reflect.Method.invoke(Method.java:511)
11-27 12:41:15.820: W/webcore(9129): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:995)
11-27 12:41:15.820: W/webcore(9129): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
11-27 12:41:15.820: W/webcore(9129): at dalvik.system.NativeStart.main(Native Method)
11-27 12:41:15.820: D/SoftKeyboardDetect(9129): Ignore this event
11-27 12:41:15.825: I/GATE(9129): <GATE-M>DEV_ACTION_COMPLETED</GATE-M>
11-27 12:41:15.830: V/(9129): NotificationPresenterImpl::setSettingsValue 0
11-27 12:41:15.830: V/(9129): NotificationPresenterImpl::setSettingsValue 0
11-27 12:41:15.835: D/webkit(9129): Firewall not null
11-27 12:41:15.835: D/webkit(9129): euler: isUrlBlocked = false
11-27 12:41:15.845: D/Cordova(9129): onPageFinished(about:blank)
11-27 12:41:15.845: D/DroidGap(9129): onMessage(onPageFinished,about:blank)
11-27 12:41:15.845: D/DroidGap(9129): onMessage(exit,null)
11-27 12:41:15.900: I/GATE(9129): <GATE-M>DEV_ACTION_COMPLETED</GATE-M>
11-27 12:41:16.245: D/DroidGap(9129): onMessage(onPageStarted,file:///android_asset/www/index.html)
11-27 12:41:16.245: D/Cordova(9129): onPageFinished(file:///android_asset/www/index.html)
11-27 12:41:16.245: D/CordovaWebView(9129): >>> loadUrlNow()
11-27 12:41:16.245: D/webkit(9129): Firewall not null
11-27 12:41:16.245: D/webkit(9129): euler: isUrlBlocked = false
11-27 12:41:16.245: D/DroidGap(9129): onMessage(onNativeReady,null)
11-27 12:41:16.245: D/DroidGap(9129): onMessage(onPageFinished,file:///android_asset/www/index.html)
11-27 12:41:16.250: D/DroidGap(9129): Paused the application!
11-27 12:41:16.250: D/CordovaWebView(9129): Handle the pause
11-27 12:41:16.250: D/CordovaWebView(9129): >>> loadUrlNow()
11-27 12:41:16.360: D/DroidGap(9129): onMessage(networkconnection,wifi)
11-27 12:41:16.370: D/DroidGap(9129): onMessage(spinner,stop)
11-27 12:41:16.375: D/webkit(9129): Firewall not null
11-27 12:41:16.375: D/webkit(9129): euler: isUrlBlocked = false
11-27 12:41:16.380: D/CordovaLog(9129): Received Event: deviceready
11-27 12:41:16.380: D/CordovaLog(9129): file:///android_asset/www/js/index.js: Line 47 : Received Event: deviceready
11-27 12:41:16.380: I/Web Console(9129): Received Event: deviceready at file:///android_asset/www/js/index.js:47
11-27 12:41:17.635: D/DroidGap(9129): onDestroy()
11-27 12:41:17.635: D/CordovaWebView(9129): >>> loadUrlNow()
11-27 12:41:17.640: D/webkit(9129): Firewall not null
11-27 12:41:17.640: D/CordovaWebView(9129): >>> loadUrlNow()
11-27 12:41:17.640: D/webkit(9129): euler: isUrlBlocked = false
11-27 12:41:17.640: D/webkit(9129): Firewall not null
11-27 12:41:17.640: D/webkit(9129): euler: isUrlBlocked = false
11-27 12:41:17.650: D/CordovaLog(9129): JSCallback Error: Request failed with status 0
11-27 12:41:17.650: D/CordovaLog(9129): file:///android_asset/www/cordova-2.1.0.js: Line 3743 : JSCallback Error: Request failed with status 0
11-27 12:41:17.650: I/Web Console(9129): JSCallback Error: Request failed with status 0 at file:///android_asset/www/cordova-2.1.0.js:3743
11-27 12:41:17.650: D/JsMessageQueue(9129): Set native->JS mode to 0
11-27 12:41:17.650: D/JsMessageQueue(9129): Set native->JS mode to 1
11-27 12:41:17.660: D/DroidGap(9129): onMessage(onPageStarted,about:blank)
11-27 12:41:17.670: I/GATE(9129): <GATE-M>DEV_ACTION_COMPLETED</GATE-M>
11-27 12:41:17.670: D/Cordova(9129): onPageFinished(about:blank)
11-27 12:41:17.670: D/DroidGap(9129): onMessage(onPageFinished,about:blank)
11-27 12:41:17.670: D/DroidGap(9129): onMessage(exit,null)
11-27 12:41:18.255: D/DroidGap(9129): onMessage(spinner,stop)
私のアプリログ:
11-27 12:36:41.810: D/DroidGap(10500): Paused the application!
11-27 12:36:41.810: D/CordovaWebView(10500): Handle the pause
11-27 12:36:41.810: D/CordovaWebView(10500): >>> loadUrlNow()
11-27 12:36:41.810: D/webkit(10500): Firewall not null
11-27 12:36:41.810: D/webkit(10500): euler: isUrlBlocked = false
11-27 12:36:41.815: D/DroidGap(10500): onDestroy()
11-27 12:36:41.850: D/CordovaWebView(10500): >>> loadUrlNow()
11-27 12:36:41.850: D/webkit(10500): Firewall not null
11-27 12:36:41.850: D/CordovaWebView(10500): >>> loadUrlNow()
11-27 12:36:41.850: D/webkit(10500): euler: isUrlBlocked = false
11-27 12:36:41.855: D/webkit(10500): Firewall not null
11-27 12:36:41.860: D/webkit(10500): euler: isUrlBlocked = false
11-27 12:36:41.865: D/DroidGap(10500): DroidGap.onCreate()
11-27 12:36:41.875: I/webclipboard(10500): clipservice: android.sec.clipboard.ClipboardExManager@4138e4e0
11-27 12:36:41.880: I/CordovaLog(10500): config.xml missing, reverting to cordova.xml
11-27 12:36:41.880: D/CordovaWebView(10500): Origin to allow: http://127.0.0.1*
11-27 12:36:41.880: I/CordovaLog(10500): Found log level DEBUG
11-27 12:36:41.880: I/CordovaLog(10500): Changing log level to DEBUG(3)
11-27 12:36:41.880: I/CordovaLog(10500): Found preference for classicRender=true
11-27 12:36:41.880: D/CordovaLog(10500): Found preference for classicRender=true
11-27 12:36:41.880: D/JsMessageQueue(10500): Set native->JS mode to 1
11-27 12:36:41.895: D/DroidGap(10500): DroidGap.init()
11-27 12:36:41.900: D/CordovaWebView(10500): >>> loadUrl(file:///android_asset/www/page_A_0.html)
11-27 12:36:41.900: D/PluginManager(10500): init()
11-27 12:36:41.900: I/PluginManager(10500): Using plugins.xml instead of config.xml. plugins.xml will eventually be deprecated
11-27 12:36:41.905: D/CordovaWebView(10500): >>> loadUrlNow()
11-27 12:36:41.910: D/DroidGap(10500): Resuming the App
11-27 12:36:41.915: I/GATE(10500): <GATE-M>DEV_ACTION_COMPLETED</GATE-M>
11-27 12:36:41.915: D/CordovaLog(10500): exception firing pause event from native
11-27 12:36:41.915: D/CordovaLog(10500): null: Line 1 : exception firing pause event from native
11-27 12:36:41.915: I/Web Console(10500): exception firing pause event from native at null:1
11-27 12:36:41.915: D/CordovaLog(10500): exception firing destroy event from native
11-27 12:36:41.915: D/CordovaLog(10500): null: Line 1 : exception firing destroy event from native
11-27 12:36:41.915: I/Web Console(10500): exception firing destroy event from native at null:1
11-27 12:36:41.915: W/System.err(10500): java.net.SocketException: Socket closed
11-27 12:36:41.915: W/System.err(10500): at libcore.io.Posix.accept(Native Method)
11-27 12:36:41.915: W/System.err(10500): at libcore.io.BlockGuardOs.accept(BlockGuardOs.java:55)
11-27 12:36:41.915: W/System.err(10500): at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:98)
11-27 12:36:41.915: W/System.err(10500): at java.net.ServerSocket.implAccept(ServerSocket.java:202)
11-27 12:36:41.915: W/System.err(10500): at java.net.ServerSocket.accept(ServerSocket.java:127)
11-27 12:36:41.920: W/System.err(10500): at org.apache.cordova.CallbackServer.run(CallbackServer.java:195)
11-27 12:36:41.920: W/System.err(10500): at java.lang.Thread.run(Thread.java:856)
11-27 12:36:41.920: D/DroidGap(10500): onMessage(onPageStarted,about:blank)
11-27 12:36:41.920: D/WML_SISO(10500): InitPasteboardJni
11-27 12:36:41.920: D/SoftKeyboardDetect(10500): Ignore this event
11-27 12:36:41.920: V/(10500): NotificationPresenterImpl::setSettingsValue 0
11-27 12:36:41.920: V/(10500): NotificationPresenterImpl::setSettingsValue 0
11-27 12:36:41.925: D/webkit(10500): Firewall not null
11-27 12:36:41.925: D/webkit(10500): euler: isUrlBlocked = false
11-27 12:36:41.930: D/SoftKeyboardDetect(10500): Ignore this event
11-27 12:36:41.935: D/Cordova(10500): onPageFinished(about:blank)
11-27 12:36:41.935: D/DroidGap(10500): onMessage(onPageFinished,about:blank)
11-27 12:36:41.935: D/DroidGap(10500): onMessage(exit,null)
11-27 12:36:41.970: D/chromium(10500): Unknown chromium error: -6
11-27 12:36:42.315: D/DroidGap(10500): onMessage(onPageStarted,file:///android_asset/www/page_A_0.html)
11-27 12:36:42.315: D/SoftKeyboardDetect(10500): Ignore this event
11-27 12:36:42.360: D/DroidGap(10500): Paused the application!
11-27 12:36:42.360: D/CordovaWebView(10500): Handle the pause
11-27 12:36:42.360: D/CordovaWebView(10500): >>> loadUrlNow()
11-27 12:36:42.555: W/IInputConnectionWrapper(10500): showStatusIcon on inactive InputConnection
11-27 12:36:43.465: D/DroidGap(10500): onDestroy()
11-27 12:36:43.465: D/CordovaWebView(10500): >>> loadUrlNow()
11-27 12:36:43.465: D/CordovaWebView(10500): >>> loadUrlNow()
11-27 12:36:43.480: E/WindowManager(10500): Activity co.uk.precedent.tesco.CordovaTuxedoActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@41449660 that was originally added here
11-27 12:36:43.480: E/WindowManager(10500): android.view.WindowLeaked: Activity co.uk.precedent.tesco.CordovaTuxedoActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@41449660 that was originally added here
11-27 12:36:43.480: E/WindowManager(10500): at android.view.ViewRootImpl.<init>(ViewRootImpl.java:414)
11-27 12:36:43.480: E/WindowManager(10500): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:282)
11-27 12:36:43.480: E/WindowManager(10500): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:218)
11-27 12:36:43.480: E/WindowManager(10500): at android.view.WindowManagerImpl$CompatModeWrapper.addView(WindowManagerImpl.java:143)
11-27 12:36:43.480: E/WindowManager(10500): at android.view.Window$LocalWindowManager.addView(Window.java:548)
11-27 12:36:43.480: E/WindowManager(10500): at android.app.Dialog.show(Dialog.java:337)
11-27 12:36:43.480: E/WindowManager(10500): at android.app.AlertDialog$Builder.show(AlertDialog.java:932)
11-27 12:36:43.480: E/WindowManager(10500): at org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:119)
11-27 12:36:43.480: E/WindowManager(10500): at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:628)
11-27 12:36:43.480: E/WindowManager(10500): at android.os.Handler.dispatchMessage(Handler.java:99)
11-27 12:36:43.480: E/WindowManager(10500): at android.os.Looper.loop(Looper.java:137)
11-27 12:36:43.480: E/WindowManager(10500): at android.app.ActivityThread.main(ActivityThread.java:4517)
11-27 12:36:43.480: E/WindowManager(10500): at java.lang.reflect.Method.invokeNative(Native Method)
11-27 12:36:43.480: E/WindowManager(10500): at java.lang.reflect.Method.invoke(Method.java:511)
11-27 12:36:43.480: E/WindowManager(10500): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:995)
11-27 12:36:43.480: E/WindowManager(10500): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
11-27 12:36:43.480: E/WindowManager(10500): at dalvik.system.NativeStart.main(Native Method)