尝试在Gingerbread模拟器上运行我的Android应用程序时出现此错误:
09-11 02:18:04.540: I/PhoneGapLog(342): phonegap.xml missing. Ignoring...
09-11 02:18:04.540: I/System.out(342): loadUrl(file:///android_asset/www/app.html)
09-11 02:18:04.550: I/System.out(342): url=file:///android_asset/www/app.html baseUrl=file:///android_asset/www/
09-11 02:18:05.150: D/SoftKeyboardDetect(342): We are in our onMeasure method
09-11 02:18:05.150: D/SoftKeyboardDetect(342): Old Height = 0
09-11 02:18:05.150: D/SoftKeyboardDetect(342): Height = 762
09-11 02:18:05.150: D/SoftKeyboardDetect(342): Old Width = 0
09-11 02:18:05.150: D/SoftKeyboardDetect(342): Width = 480
09-11 02:18:05.150: D/SoftKeyboardDetect(342): Ignore this event
09-11 02:18:05.332: D/SoftKeyboardDetect(342): We are in our onMeasure method
09-11 02:18:05.332: D/SoftKeyboardDetect(342): Old Height = 762
09-11 02:18:05.340: D/SoftKeyboardDetect(342): Height = 762
09-11 02:18:05.340: D/SoftKeyboardDetect(342): Old Width = 480
09-11 02:18:05.340: D/SoftKeyboardDetect(342): Width = 480
09-11 02:18:05.370: D/SoftKeyboardDetect(342): Ignore this event
09-11 02:18:24.910: I/System.out(342): onReceivedError: Error code=-6 Description=The connection to the server was unsuccessful. URL=file:///android_asset/www/app.html
09-11 02:18:28.920: E/WindowManager(342): Activity com.ohla.OhlaActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@4057a2f8 that was originally added here
09-11 02:18:28.920: E/WindowManager(342): android.view.WindowLeaked: Activity com.ohla.OhlaActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@4057a2f8 that was originally added here
09-11 02:18:28.920: E/WindowManager(342): at android.view.ViewRoot.<init>(ViewRoot.java:258)
09-11 02:18:28.920: E/WindowManager(342): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
09-11 02:18:28.920: E/WindowManager(342): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
09-11 02:18:28.920: E/WindowManager(342): at android.view.Window$LocalWindowManager.addView(Window.java:424)
09-11 02:18:28.920: E/WindowManager(342): at android.app.Dialog.show(Dialog.java:241)
09-11 02:18:28.920: E/WindowManager(342): at android.app.AlertDialog$Builder.show(AlertDialog.java:802)
09-11 02:18:28.920: E/WindowManager(342): at com.phonegap.DroidGap$6.run(DroidGap.java:1483)
09-11 02:18:28.920: E/WindowManager(342): at android.os.Handler.handleCallback(Handler.java:587)
09-11 02:18:28.920: E/WindowManager(342): at android.os.Handler.dispatchMessage(Handler.java:92)
09-11 02:18:28.920: E/WindowManager(342): at android.os.Looper.loop(Looper.java:123)
09-11 02:18:28.920: E/WindowManager(342): at android.app.ActivityThread.main(ActivityThread.java:3683)
09-11 02:18:28.920: E/WindowManager(342): at java.lang.reflect.Method.invokeNative(Native Method)
09-11 02:18:28.920: E/WindowManager(342): at java.lang.reflect.Method.invoke(Method.java:507)
09-11 02:18:28.920: E/WindowManager(342): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
09-11 02:18:28.920: E/WindowManager(342): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
09-11 02:18:28.920: E/WindowManager(342): at dalvik.system.NativeStart.main(Native Method)
09-11 02:18:28.920: E/WindowManager(342): Activity com.ohla.OhlaActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@4057a2f8 that was originally added here
09-11 02:18:28.920: E/WindowManager(342): android.view.WindowLeaked: Activity com.ohla.OhlaActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@4057a2f8 that was originally added here
09-11 02:18:28.920: E/WindowManager(342): at android.view.ViewRoot.<init>(ViewRoot.java:258)
09-11 02:18:28.920: E/WindowManager(342): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
09-11 02:18:28.920: E/WindowManager(342): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
09-11 02:18:28.920: E/WindowManager(342): at android.view.Window$LocalWindowManager.addView(Window.java:424)
09-11 02:18:28.920: E/WindowManager(342): at android.app.Dialog.show(Dialog.java:241)
09-11 02:18:28.920: E/WindowManager(342): at android.app.AlertDialog$Builder.show(AlertDialog.java:802)
09-11 02:18:28.920: E/WindowManager(342): at com.phonegap.DroidGap$6.run(DroidGap.java:1483)
09-11 02:18:28.920: E/WindowManager(342): at android.os.Handler.handleCallback(Handler.java:587)
09-11 02:18:28.920: E/WindowManager(342): at android.os.Handler.dispatchMessage(Handler.java:92)
09-11 02:18:28.920: E/WindowManager(342): at android.os.Looper.loop(Looper.java:123)
09-11 02:18:28.920: E/WindowManager(342): at android.app.ActivityThread.main(ActivityThread.java:3683)
09-11 02:18:28.920: E/WindowManager(342): at java.lang.reflect.Method.invokeNative(Native Method)
09-11 02:18:28.920: E/WindowManager(342): at java.lang.reflect.Method.invoke(Method.java:507)
09-11 02:18:28.920: E/WindowManager(342): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
09-11 02:18:28.920: E/WindowManager(342): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
09-11 02:18:28.920: E/WindowManager(342): at dalvik.system.NativeStart.main(Native Method)
09-11 02:18:33.549: D/dalvikvm(342): GC_EXPLICIT freed 396K, 55% free 2929K/6407K, external 2388K/2982K, paused 77ms
如何解决此Activity com.ohla.OhlaActivity has leaked window
错误?这与assets/www
文件夹中的Web应用程序文件有关吗?但是,当我在桌面浏览器中的assets/www
上运行Web应用程序时,根本没有问题。
我正在使用Sencha Touch开发网络应用程序。当我在模拟器中运行PhoneGap应用程序时,会显示以下错误消息:The connection to server was unsuccessful. (file:///android_asset/www/app.html)