coolchandrakumar
07/08/2020, 9:48 AMAndroidView(view = webview(ctx, "test"))
Facing crash in Huawei device while using AndroidView for converting ClassicView to compose. It is working in emulator and samsung device
fun webview(ctx: Context, html: String) = WebView(ctx).apply {
Log.d("ChanLog", "webview: $html")
this.webViewClient = WebViewClient()
loadData("<html><body><h1>Ch($html)</h1></body></html>", "text/html", "utf-8")
}
at androidx.ui.core.AndroidViewsHandler.onDescendantInvalidated(AndroidViewsHandler.kt:40)
at android.view.HwApsImpl.isNonEmptyFrameCase(HwApsImpl.java:353)
at android.view.ViewGroup.invalidateChild(ViewGroup.java:5984)
at android.view.View.invalidateInternal(View.java:17751)
at android.view.View.invalidate(View.java:17702)
at android.view.View.setFrame(View.java:22267)
at android.webkit.WebView.access$701(WebView.java:107)
Mihai Popa
07/08/2020, 11:04 AMAndrey Kulikov
07/08/2020, 11:30 AMremember
. AndroidView(view = remember { webview(ctx, "test") })
so the view is not recreated everytime this function is recomposedcoolchandrakumar
07/08/2020, 1:01 PMAndrey Kulikov
07/08/2020, 1:02 PMcoolchandrakumar
07/08/2020, 1:03 PMcoolchandrakumar
07/08/2020, 1:09 PM--------- beginning of crash
2020-07-08 18:35:49.258 22741-22741/com.chan.composetryout E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.chan.composetryout, PID: 22741
java.lang.NullPointerException
at androidx.ui.core.AndroidViewsHandler.onDescendantInvalidated(AndroidViewsHandler.kt:40)
at android.view.HwApsImpl.isNonEmptyFrameCase(HwApsImpl.java:353)
at android.view.ViewGroup.invalidateChild(ViewGroup.java:5984)
at android.view.View.invalidateInternal(View.java:17751)
at android.view.View.invalidate(View.java:17702)
at android.view.View.setFrame(View.java:22267)
at android.webkit.WebView.access$701(WebView.java:107)
Andrey Kulikov
07/08/2020, 1:14 PMcoolchandrakumar
07/08/2020, 1:14 PMdef compose_version = "0.1.0-dev14"
Andrey Kulikov
07/08/2020, 1:15 PMcoolchandrakumar
07/08/2020, 2:03 PM