我正在运行低于API版本21的手机上获得NoClassDefoundError。首先,它与其他类一起出现,在移除所有可能的代码之后,它开始与毕加索库一起出现。我已经附上了我的logcat和build.gradle。
compileSdkVersion 23
buildToolsVersion "23.0.3"
useLibrary 'org.apache.http.legacy'
dexOptions {
incremental false
javaMaxHeapSize "2048M"
preDexLibraries = false
}
defaultConfig {
applicationId "com.kaaryanext.raghukaka"
minSdkVersion 15
targetSdkVersion 23
versionCode 25
versionName "1.2.14"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-android.txt'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:multidex:1.0.0'
compile 'com.google.code.gson:gson:2.2.4'
compile('com.android.support:appcompat-v7:23.1.1') {
exclude module: 'support-v4'
}
compile 'com.crittercism:crittercism-android-agent:5.0.6'
compile 'com.android.support:support-v4:23.1.1'
compile "com.android.support:recyclerview-v7:23.1.0"
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile "com.google.android.gms:play-services:8.1.0"
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:design:23.1.1'
compile 'com.getbase:floatingactionbutton:1.10.0'
compile 'com.loopj.android:android-async-http:1.4.9'
}
尝试以下代码
public class MyApplication extends Application {
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(base);
}
}
并在应用程序标记中的android menifest文件中添加以下行
android:name="your package name.MyApplication"