Android webviewglue:nativeDestroy视图后WebView页面加载失败

Android webviewglue:nativeDestroy视图后WebView页面加载失败,android,webview,Android,Webview,我在一些Android设备上有以下问题(我现在可以在Galaxy Note II和Galaxy S4上重现): Web视图无法加载页面。没有错误或onReceivedError调用,但是onPageFinished也没有被激发。我实现了进度回调以查看页面是否正在加载。日志中有以下内容: 11-11 17:15:23.380 D/WebView (14099): loadUrlImpl: called 11-11 17:15:23.395 V/webkit (14099): BrowserFra

我在一些Android设备上有以下问题(我现在可以在Galaxy Note II和Galaxy S4上重现): Web视图无法加载页面。没有错误或onReceivedError调用,但是onPageFinished也没有被激发。我实现了进度回调以查看页面是否正在加载。日志中有以下内容:

11-11 17:15:23.380 D/WebView (14099): loadUrlImpl: called
11-11 17:15:23.395 V/webkit  (14099): BrowserFrame constructor: this=Handler (android.webkit.BrowserFrame) {424c9b48}
11-11 17:15:23.420 D/webcore (14099):  CORE loadUrl: called
11-11 17:15:23.420 E/SQLiteLog(14099): (1) no such table: CacheGroups
11-11 17:15:23.425 D/WebKit  (14099): ERROR:
11-11 17:15:23.425 D/WebKit  (14099): Application Cache Storage: failed to execute statement "DELETE FROM CacheGroups" error "no such table: CacheGroups"
11-11 17:15:23.425 D/WebKit  (14099):
11-11 17:15:23.425 D/WebKit  (14099): external/webkit/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp(558) : bool WebCore::ApplicationCacheStorage::executeSQLCommand(const WTF::String&)
11-11 17:15:23.425 E/SQLiteLog(14099): (1) no such table: Caches
11-11 17:15:23.425 D/WebKit  (14099): ERROR:
11-11 17:15:23.425 D/WebKit  (14099): Application Cache Storage: failed to execute statement "DELETE FROM Caches" error "no such table: Caches"
11-11 17:15:23.425 D/WebKit  (14099):
11-11 17:15:23.425 D/WebKit  (14099): external/webkit/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp(558) : bool WebCore::ApplicationCacheStorage::executeSQLCommand(const WTF::String&)
11-11 17:15:23.425 E/SQLiteLog(14099): (1) no such table: Origins
11-11 17:15:23.425 D/WebKit  (14099): ERROR:
11-11 17:15:23.425 D/WebKit  (14099): Application Cache Storage: failed to execute statement "DELETE FROM Origins" error "no such table: Origins"
11-11 17:15:23.425 D/WebKit  (14099):
11-11 17:15:23.425 D/WebKit  (14099): external/webkit/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp(558) : bool WebCore::ApplicationCacheStorage::executeSQLCommand(const WTF::String&)
11-11 17:15:23.425 E/SQLiteLog(14099): (1) no such table: DeletedCacheResources
11-11 17:15:23.505 E/de.my.app.webview.MyWebChromeClient(14099): Progress: 10
11-11 17:15:24.205 E/de.my.app.webview.MyWebChromeClient(14099): Progress: 30
11-11 17:15:24.210 E/de.my.app.webview.MyWebChromeClient(14099): Progress: 49
11-11 17:15:24.985 E/de.my.app.webview.MyWebChromeClient(14099): Progress: 68
11-11 17:15:28.035 D/dalvikvm(14099): GC_CONCURRENT freed 1905K, 6% free 53808K/56967K, paused 13ms+17ms, total 69ms
11-11 17:15:28.085 D/webviewglue(14099): nativeDestroy view: 0x62e7e6a8
11-11 17:15:28.535 I/GATE    (14099): <GATE-M>DEV_ACTION_COMPLETED</GATE-M>
11-11 17:15:23.380 D/WebView(14099):loadUrlImpl:called
11-11 17:15:23.395v/webkit(14099):浏览器框架构造函数:this=Handler(android.webkit.BrowserFrame){424c9b48}
11-11 17:15:23.420 D/webcore(14099):核心加载URL:已调用
11-11 17:15:23.420 E/SQLiteLog(14099):(1)没有这样的表:缓存组
11-11 17:15:23.425 D/WebKit(14099):错误:
11-11 17:15:23.425 D/WebKit(14099):应用程序缓存存储:未能执行语句“从缓存组中删除”错误“无此类表:缓存组”
11-11 17:15:23.425 D/WebKit(14099):
11-11 17:15:23.425 D/WebKit(14099):外部/WebKit/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp(558):bool WebCore::ApplicationCacheStorage::executeSQLCommand(const WTF::String&)
11-11 17:15:23.425e/SQLiteLog(14099):(1)没有这样的表:缓存
11-11 17:15:23.425 D/WebKit(14099):错误:
11-11 17:15:23.425 D/WebKit(14099):应用程序缓存存储:未能执行语句“从缓存中删除”错误“无此类表:缓存”
11-11 17:15:23.425 D/WebKit(14099):
11-11 17:15:23.425 D/WebKit(14099):外部/WebKit/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp(558):bool WebCore::ApplicationCacheStorage::executeSQLCommand(const WTF::String&)
11-11 17:15:23.425e/SQLiteLog(14099):(1)没有这样的表:来源
11-11 17:15:23.425 D/WebKit(14099):错误:
11-11 17:15:23.425 D/WebKit(14099):应用程序缓存存储:未能执行语句“从源代码中删除”错误“没有这样的表:源代码”
11-11 17:15:23.425 D/WebKit(14099):
11-11 17:15:23.425 D/WebKit(14099):外部/WebKit/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp(558):bool WebCore::ApplicationCacheStorage::executeSQLCommand(const WTF::String&)
11-11 17:15:23.425e/SQLiteLog(14099):(1)没有这样的表:DeletedCacheResources
11-11 17:15:23.505 E/de.my.app.webview.MyWebChromeClient(14099):进度:10
11-11 17:15:24.205 E/de.my.app.webview.MyWebChromeClient(14099):进度:30
11-11 17:15:24.210 E/de.my.app.webview.MyWebChromeClient(14099):进度:49
11-11 17:15:24.985 E/de.my.app.webview.MyWebChromeClient(14099):进度:68
11-11 17:15:28.035 D/dalvikvm(14099):GC_并发释放1905K,6%释放53808K/56967K,暂停13ms+17ms,总计69ms
11-11 17:15:28.085 D/webviewglue(14099):nativeDestroy视图:0x62e7e6a8
11-11 17:15:28.535 I/GATE(14099):开发行动完成

它可以在其他测试设备上正常工作。有人能解释一下我做错了什么吗?

原因是,我有一个WebView预加载程序,如果加载完成并发送回调消息,它会显示WebView。WebView本身没有分配给变量,在某些设备上被垃圾收集器删除。

您能解释一下吗?如何解决这个问题。我在某些android设备上使用Phonegap时遇到了类似的问题,真的很烦人。@user2412555我在我的项目中没有使用Phonegap,但我在搜索解决方案时看到了Phonegap的一些类似问题。但在我的例子中是这样的:我有一个WebViewWrapper类,它是所有WebView回调的侦听器,如果加载了WebView,它会向调用方发送回调。我仅使用新的WebViewWrapper初始化了WebViewWrapper(此);没有将其设置为变量。在WebView加载过程中,GC发布了实例和WebView本身。在这种情况下,您需要将其设置为一个实例变量,并让它一直存在,直到页面加载为止。