1

In my application after successfully login, loading data through retrofit library. from last two days i founded one major issue in my application. below android API level 21 application getting crashes i checked in console and logs. i got "FATAL EXCEPTION" due to no class def found error. same app working above android API level 23.

in build.gradle file

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"

    defaultConfig {
        applicationId "com.example.rsukumar.gluser"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        // Enabling multidex support.
        multiDexEnabled true
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'

    //dagger 2
    compile 'com.google.dagger:dagger:2.0.2'
    provided 'com.google.dagger:dagger-compiler:2.0'
    provided 'javax.annotation:jsr250-api:1.0'
    compile 'com.neenbedankt.gradle.plugins:android-apt:1.8'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.daimajia.easing:library:1.0.1@aar'
    compile 'com.daimajia.androidanimations:library:1.1.3@aar'

    //retrofit 2
    compile 'com.squareup.retrofit:adapter-rxjava:2.0.0-beta2'
    compile 'com.squareup.retrofit:retrofit:2.0.0-beta2'
    compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
}

enter image description here

My main question is why i'm getting above exception and error? that too in different Android API levels.

Catarina Ferreira
  • 1,824
  • 5
  • 17
  • 26
PSP
  • 59
  • 8

1 Answers1

-1

this problem can be related to multidex support for your application. Android Version < 21 do not support Multidex by default. You need to enhance your application. I followed the following instructions to resovle this problem for my applications API Level < 21

Graham
  • 7,431
  • 18
  • 59
  • 84
Michael Meyer
  • 2,179
  • 3
  • 24
  • 33
  • thank u michael, due to multidex apk file size inreacred. may i know how to reduce size of the apk file – PSP Apr 10 '17 at 14:25
  • 3
    What are the following instructions to resolve this problem? It is not very helpful to announce that you have a solution to the problem but then do not provide the solution... – Jeff.H Aug 30 '18 at 15:20