GithubHelp home page GithubHelp logo

发现问题 about safe-java-js-webview-bridge HOT 7 OPEN

pedant avatar pedant commented on July 2, 2024
发现问题

from safe-java-js-webview-bridge.

Comments (7)

brucewuu520 avatar brucewuu520 commented on July 2, 2024

@pedant 收到了吗

from safe-java-js-webview-bridge.

pedant avatar pedant commented on July 2, 2024

我这边destory webview关联的activity也无法重现你的异常。不过从你的异常日志上看来,应该不是webview已经被回收的问题。因为如果是那样,会直接在android.webkit.WebView.loadUrl这里报空指针。另外每个JsCallback中强引用了相关联的WebView,即使activity退出销毁后也能正常执行回调JS,但如果回调的js涉及更新UI,则会有下面的异常。

11-27 10:46:45.992  22168-22168/cn.pedant.SafeWebViewBridge.sample E/Web Console﹕ Uncaught HostApp call error, code:500, message:method execute error:Unable to add window -- token android.os.BinderProxy@416894a0 is not valid; is your activity running? at null:1

但这里强引用引出个了新问题,就是可能造成内存泄漏。所以我更新下代码,使用SoftReference来包装JsCallback引用的WebView。

from safe-java-js-webview-bridge.

brucewuu520 avatar brucewuu520 commented on July 2, 2024

ok

from safe-java-js-webview-bridge.

pedant avatar pedant commented on July 2, 2024

提交 23fed5d

from safe-java-js-webview-bridge.

brucewuu520 avatar brucewuu520 commented on July 2, 2024

Gradle部署下吧?我也测测看

from safe-java-js-webview-bridge.

pedant avatar pedant commented on July 2, 2024

已部署

repositories {
    mavenCentral()
}

dependencies {
    compile 'cn.pedant.safewebviewbridge:library:1.4'
}

from safe-java-js-webview-bridge.

guofeng007 avatar guofeng007 commented on July 2, 2024

看下出现这个crash的手机系统是不是4.1.2,这个版本上的webview的问题,参见下面的链接
https://groups.google.com/forum/#!topic/google-admob-ads-sdk/tjqDzFJk98w

sorry这个可能不准,在其他地方也看到这个类似的bug,

from safe-java-js-webview-bridge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.