加载活动时出现NoClassDefFoundError

时间:2018-07-24 07:58:57

标签: java android android-studio gradle noclassdeffounderror

在加载我的应用程序时抛出此错误,然后正常显示布局。如何阻止它引发此错误?发生在android 8和android 6上。

https://pastebin.com/AyYkdeY0

build.gradle

apply plugin: 'ashcollauthlogin.darkzek.com'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "ashcollauthlogin.darkzek.com"
        minSdkVersion 18
        targetSdkVersion 28
        versionCode 2
        versionName "2"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
    buildToolsVersion '27.0.3'
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    api 'com.android.support:design:28.0.0-alpha3'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:customtabs:28.0.0-alpha3'
    implementation 'com.android.support.constraint:constraint-layout:1.1.1'
    implementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.google.android.gms:play-services-ads:15.0.1'
    implementation 'com.github.navasmdc:MaterialDesign:1.5@aar'
    implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
    implementation 'com.android.support:support-v13:28.0.0-alpha3'
}
repositories {
    jcenter()
}

SettingsActivity.java:43

setContentView(R.layout.activity_settings);

1 个答案:

答案 0 :(得分:0)

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "ashcollauthlogin.darkzek.com"
        minSdkVersion 18
        targetSdkVersion 28
        versionCode 2
        versionName "2"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }