简体   繁体   中英

NoClassDefFound error on older devices

Since a couple of weeks I'm not able to run my app anymore on older devices. It works fine on my OnePlus One for example, or on the SGS5 but not on my Galaxy S3.

When I debug the app through Android Studio, it throws a NoClassDefFoundError for a just created custom class.

java.lang.NoClassDefFoundError: com.appsbv.sample.ComponentsEndpoint

Do you guys know how to solve this? PS I'm running Android Studio 1.3 on OS X

Below my gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion '22.0.0'
    defaultConfig {
        applicationId "com.appsbv.sample"
        minSdkVersion 14
        targetSdkVersion 22
        versionCode 17
        versionName "7.0"
        multiDexEnabled true
    }
    buildTypes {
        debug {
            minifyEnabled false
        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    lintOptions {
        abortOnError false
    }
    productFlavors {
    }
}

repositories {
    // for downloading polypicker dependency cwac-camera
    maven { url 'https://repo.commonsware.com.s3.amazonaws.com' }
    // Goodbye Maven Central
    maven { url 'https://jitpack.io' }
}

dependencies {
    compile project(':library')
    compile 'com.google.code.gson:gson:2.3.1'
    compile 'org.parceler:parceler:0.2.16'
    compile 'com.squareup.retrofit:retrofit:1.9.0'
    compile 'com.squareup.okhttp:okhttp:2.4.0'
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.4.0'
    compile 'in.srain.cube:grid-view-with-header-footer:1.0.11'
    compile 'com.tonicartos:stickygridheaders:1.0.1'
    compile 'com.parse.bolts:bolts-android:1.1.3'
    compile 'com.soundcloud.android:android-crop:1.0.0@aar'
    compile 'com.google.android.gms:play-services:6.5.87'
    compile files('src/main/java/com/appsbv/Parse-1.9.1.jar')
    compile 'com.github.jaydeepw:poly-picker:v1.0.14'
}

That ComponentsEndpoint class looks like this:

public class ComponentsEndpoint implements Endpoint {
    private static final String PROTOCOL = "http://";
    private static final String BASE = ".appsbv.nl/v1";
    private String url;
    private String service;
    public void setService(String serv) {
        service = serv;
        url = PROTOCOL + serv + BASE;
    }
    @Override
    public String getName() {
        return service;
    }
    @Override
    public String getUrl() {
        if (url == null) {
            throw new IllegalStateException("Illegal URL.");
        }
        return url;
    }
}

add this to your build.gradle nd you will be good to go

dependencies {
compile 'com.android.support:multidex:1.0.0'
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM