CacheWebView icon indicating copy to clipboard operation
CacheWebView copied to clipboard

初始化失败

Open daobage opened this issue 5 years ago • 5 comments

Process: com.example.php.webviewdemo, PID: 26774 java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/Cache; at ren.yale.android.cachewebviewlib.WebViewCacheInterceptor.initHttpClient(WebViewCacheInterceptor.java:90) at ren.yale.android.cachewebviewlib.WebViewCacheInterceptor.(WebViewCacheInterceptor.java:76) at ren.yale.android.cachewebviewlib.WebViewCacheInterceptor$Builder.build(WebViewCacheInterceptor.java:369) at ren.yale.android.cachewebviewlib.WebViewCacheInterceptorInst.init(WebViewCacheInterceptorInst.java:25) at com.example.php.webviewdemo.App.onCreate(App.kt:10) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1028) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5662) at android.app.ActivityThread.-wrap2(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1706) at android.os.Handler.dispatchMessage(Handler.java:102)

daobage avatar Aug 10 '18 03:08 daobage

添加混淆配置试试:

#CacheWebview
-dontwarn ren.yale.android.cachewebviewlib.**
-keep class ren.yale.android.cachewebviewlib.**{*;}

#okhttp
-dontwarn okhttp3.**
-keep class okhttp3.**{*;}

#okio
-dontwarn okio.**
-keep class okio.**{*;}

yale8848 avatar Aug 10 '18 09:08 yale8848

我也是这样,添加混淆好像没效果

Alsvider avatar Sep 14 '18 07:09 Alsvider

是不是okhttp包冲突了,我库里也用到okhttp了,如果是这个问题,可以在用exclude试试

yale8848 avatar Sep 15 '18 00:09 yale8848

添加okhttp的依赖 implementation 'com.squareup.okhttp3:okhttp:3.10.0'

LitterSun avatar Nov 28 '18 05:11 LitterSun

我的天,这个依赖不加竟然无法初始化 添加okhttp的依赖 implementation 'com.squareup.okhttp3:okhttp:3.10.0'

liuhuiAndroid avatar Jun 11 '19 04:06 liuhuiAndroid