plus.zip.compressImage({
src: e,
dst: '_doc/' + name,
overwrite: true,
quality: 50,
format:'jpg'
}, function(zip) {
alert("运行到了2");
size += zip.size;
console.log("filesize:"+zip.size+",totalsize:"+size);
if (size > (10*1024*1024)) {
return mui.toast('文件超大,请重新选择~');
}
if (!self.parentNode.classList.contains('space')) { //已有图片
feedback.files.splice(index-1,1,{name:"images"+index,path:e});
} else { //加号
placeholder.classList.remove('space');
feedback.addFile(zip.target);
feedback.newPlaceholder();
}
up.classList.remove('image-up');
placeholder.style.backgroundImage = 'url(' + zip.target + ')';
}, function(zipe) {
mui.toast('压缩失败!')
});
W/WebView: java.lang.Throwable: A WebView method was called on thread 'Thread-2455'. All WebView methods must be called on the same thread. (Expected Looper Looper (main, tid 1) {66b7789} called on null, FYI main Looper is Looper (main, tid 1) {66b7789})
at android.webkit.WebView.checkThread(WebView.java:2292)
at android.webkit.WebView.getUrl(WebView.java:1374)
at io.dcloud.common.adapter.ui.AdaWebview.obtainFullUrl(AdaWebview.java:231)
at io.dcloud.feature.pdr.a$b.a(CompressImage.java:224)
at io.dcloud.feature.pdr.a$b.a(CompressImage.java:195)
at io.dcloud.feature.pdr.a.b(CompressImage.java:66)
at io.dcloud.feature.pdr.a$1.run(CompressImage.java:42)
at java.lang.Thread.run(Thread.java:818)
E/AndroidRuntime: FATAL EXCEPTION: Thread-2455
Process: com.android.leon.njgddpolling, PID: 9693
java.lang.RuntimeException: java.lang.Throwable: A WebView method was called on thread 'Thread-2455'. All WebView methods must be called on the same thread. (Expected Looper Looper (main, tid 1) {66b7789} called on null, FYI main Looper is Looper (main, tid 1) {66b7789})
at android.webkit.WebView.checkThread(WebView.java:2302)
at android.webkit.WebView.getUrl(WebView.java:1374)
at io.dcloud.common.adapter.ui.AdaWebview.obtainFullUrl(AdaWebview.java:231)
at io.dcloud.feature.pdr.a$b.a(CompressImage.java:224)
at io.dcloud.feature.pdr.a$b.a(CompressImage.java:195)
at io.dcloud.feature.pdr.a.b(CompressImage.java:66)
at io.dcloud.feature.pdr.a$1.run(CompressImage.java:42)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.Throwable: A WebView method was called on thread 'Thread-2455'. All WebView methods must be called on the same thread. (Expected Looper Looper (main, tid 1) {66b7789} called on null, FYI main Looper is Looper (main, tid 1) {66b7789})
at android.webkit.WebView.checkThread(WebView.java:2292)
at android.webkit.WebView.getUrl(WebView.java:1374)
at io.dcloud.common.adapter.ui.AdaWebview.obtainFullUrl(AdaWebview.java:231)
at io.dcloud.feature.pdr.a$b.a(CompressImage.java:224)
at io.dcloud.feature.pdr.a$b.a(CompressImage.java:195)
at io.dcloud.feature.pdr.a.b(CompressImage.java:66)
at io.dcloud.feature.pdr.a$1.run(CompressImage.java:42)
at java.lang.Thread.run(Thread.java:818)
I/Process: Sending signal. PID: 9693 SIG: 9
Disconnected from the target VM, address: 'localhost:8602', transport: 'socket'
4 个回复
1***@qq.com
解决了吗? android手机在4.4以下版本可以,但是5.0及以上版本就报这个错误,怎么处理?
k***@126.com
解决了吗?
d***@sohu.com
请尽快解决这个问题吧,用户只能眼巴巴的干等着。就是在非UI线程里面调用了WebView只允许在UI线程中调用的方法。
d***@sohu.com
2017-4-14日标注已解决,但是我升级后,还是报这个错误,开发组可以联系我 13811036657