AAChartCore-Kotlin icon indicating copy to clipboard operation
AAChartCore-Kotlin copied to clipboard

Android webview 有问题

Open AmoyJJ opened this issue 5 years ago • 2 comments

1 android.view.InflateException:Binary XML file line #300: Binary XML file line #300: Error inflating class com.aachartmodel.aainfographics.AAInfographicsLib.AAChartCreator.AAChartView 2 ...... 3 Caused by: 4 java.lang.RuntimeException:Using WebView from more than one process at once with the same data directory is not supported. https://crbug.com/558377 5 org.chromium.android_webview.AwBrowserProcess.b(PG:3183) 6 my.b(PG:147) 7 my.b(PG:260) 8 my.a(PG:240) 9 com.android.webview.chromium.WebViewChromiumFactoryProvider.a(PG:539) 10 com.android.webview.chromium.WebViewChromium.init(PG:180) 11 android.webkit.WebView.(WebView.java:679) 12 android.webkit.WebView.(WebView.java:605) 13 android.webkit.WebView.(WebView.java:588) 14 android.webkit.WebView.(WebView.java:575) 15 com.aachartmodel.aainfographics.AAInfographicsLib.AAChartCreator.AAChartView.(AAChartView.kt:112) 16 java.lang.reflect.Constructor.newInstance0(Native Method) 17 java.lang.reflect.Constructor.newInstance(Constructor.java:343) 18 android.view.LayoutInflater.createView(LayoutInflater.java:658) 19 android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:801) 20 android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)

AmoyJJ avatar Aug 22 '20 06:08 AmoyJJ

老哥解决了吗?

LeonShannon avatar Sep 07 '20 03:09 LeonShannon

//Android P 以及之后版本不支持同时从多个进程使用具有相同数据目录的WebView if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { var processName = getProcessName(this) if ("com.platform.education" != processName) {//判断不等于默认进程名称 WebView.setDataDirectorySuffix(processName) } } 在application加这段就行了

AmoyJJ avatar Sep 07 '20 03:09 AmoyJJ