java.lang.NoClassDefFoundError: Failed resolution of: Lio/bugtags/agent/instrumentation/okhttp3/OkHt
2017-11-16 17:09
204 查看
在使用Retrofit2.0的时候碰见这个问题:
找了一半天最后修改了一下Gradle的版本就解决了,要注意Gradle和Gradle插件的版本要对应上
Gradle:gradle-wrapper.properties文件中的gradle;
Gradle插件:project的build.gralde中的classpath对应的gradle;
1、Gradle插件设置:
我项目的build.gradle,注意不是module的build.gradle
2、Gradle设置
我之前使用的Gradle版本是3.3修改为2.14.1后就可以了,原因我还不知道,有路过的大神请给答案,谢了。
java.lang.NoClassDefFoundError: Failed resolution of: Lio/bugtags/agent/instrumentation/okhttp3/OkHttp3Instrumentation;
找了一半天最后修改了一下Gradle的版本就解决了,要注意Gradle和Gradle插件的版本要对应上
Gradle:gradle-wrapper.properties文件中的gradle;
Gradle插件:project的build.gralde中的classpath对应的gradle;
1、Gradle插件设置:
我项目的build.gradle,注意不是module的build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.2.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() } } task clean(type: Delete) { delete rootProject.buildDir }
2、Gradle设置
#Thu Nov 16 14:49:15 CST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
我之前使用的Gradle版本是3.3修改为2.14.1后就可以了,原因我还不知道,有路过的大神请给答案,谢了。
相关文章推荐
- java.lang.NoClassDefFoundError: Failed resolution of: Ljava/awt/GraphicsEnvironment
- java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/animation/AnimatorCompatHelper
- java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/LruCache;
- 听云SDK影响其他项目报Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/networkbench/agent
- java.lang.NoClassDefFoundError: Failed resolution of: Lcom/baidu/mapapi/SDKInitializer;
- Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/jxmpp/util/XmppStringUtils;
- 听云SDK影响其他项目报Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/networkbench/agent
- java.lang.NoClassDefFoundError: Failed resolution of
- java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/animation/AnimatorCompatHe
- java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support4/animation/AnimatorCompatHelp
- java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/animation/AnimatorCompatHe
- Java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/animation/AnimatorCompatHe
- java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7
- java.lang2.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/widget/TintManager;
- java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/animation/AnimatorCompatHe
- java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/internal/Platform
- Android, JSONLIB , java.lang.NoClassDefFoundError: Failed resolution of: Lnet/sf/json/JSONArray; 原因
- 解决 java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/desig问题
- java.lang.NoClassDefFoundError: Failed resolution of: Landroid/icu/text/SimpleDateFormat;
- java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support4/content/ContextCompat;