Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x5 版本 7.0.0 webview Loading 时崩溃 #34

Open
codemilestones opened this issue Sep 24, 2020 · 1 comment
Open

x5 版本 7.0.0 webview Loading 时崩溃 #34

codemilestones opened this issue Sep 24, 2020 · 1 comment

Comments

@codemilestones
Copy link

崩溃路径:

30144 09-23 19:22:33.431 E 5780 5780 AndroidRuntime:   Process: com.fenbi.android.solar, PID: 5780
30145 09-23 19:22:33.431 E 5780 5780 AndroidRuntime:   java.lang.ClassCastException: android.graphics.drawable.BitmapDrawable cannot be cast to android.graphics.drawable.AnimationDrawable
30146 09-23 19:22:33.431 E 5780 5780 AndroidRuntime:   at com.youzan.androidsdkx5.view.LoadingView.setImage(LoadingView.java:50)
30147 09-23 19:22:33.431 E 5780 5780 AndroidRuntime:   at com.youzan.androidsdkx5.plugin.WebClientWrapper$1.run(WebClientWrapper.java:423)
30148 09-23 19:22:33.431 E 5780 5780 AndroidRuntime:   at android.os.Handler.handleCallback(Handler.java:900)
30149 09-23 19:22:33.431 E 5780 5780 AndroidRuntime:   at android.os.Handler.dispatchMessage(Handler.java:103)
30150 09-23 19:22:33.431 E 5780 5780 AndroidRuntime:   at android.os.Looper.loop(Looper.java:219)
30151 09-23 19:22:33.431 E 5780 5780 AndroidRuntime:   at android.app.ActivityThread.main(ActivityThread.java:8347)
30152 09-23 19:22:33.431 E 5780 5780 AndroidRuntime:   at java.lang.reflect.Method.invoke(Native Method)
30153 09-23 19:22:33.431 E 5780 5780 AndroidRuntime:   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
30154 09-23 19:22:33.431 E 5780 5780 AndroidRuntime:   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)

fragment 初始化代码

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
    super.onViewCreated(view, savedInstanceState)
    webView.loadUrl(SolarUrl.getMallYouzanStoreUrl())

    webView.subscribe(object : AbsAuthEvent() {
        override fun call(context: Context?, needLogin: Boolean) {
            if (needLogin && !UserManager.getInstance().isUserLogin) {
                LoginManager.builder().loginSuccessRouter(object : ILoginSuccessRouter {
                    override fun onLoginSuccess(activity: Activity) {
                        requestYouzanCookie(context)
                    }
                }).loginCloseRouter(object : ILoginCloseRouter {
                    override fun onLoginClose(activity: Activity) {
                        webView.syncNot()
                    }
                })
            } else {
                requestYouzanCookie(context)
            }
        }

        private fun requestYouzanCookie(context: Context?) {
            val token = YouzanToken()
            token.accessToken = "接口返回的access_token"
            token.cookieKey = "接口返回的cookie_key"
            token.cookieValue = "接口返回的cookie_value"

            YouzanSDK.sync(context!!, token)
            webView.sync(token)
        }
    })
}
@dengshiwei
Copy link

@foxapple 你本地 Gradle 缓存有 7.0 的包吗?能发给我一下吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants