0

Need a bit of help here!, I have built an application with min api level 15 and target api level 23, now the problem is when i deploy the app on to a phone with api 19 or any phone less than api 22 the app crashes on start up. Please help me out guys? I tried adding permissions in the manifest file but in the end it would be overriden by the build.gradle(Module App) file. I am confused with it and trying to resolve it. Please help me out!

Thanks in Advance!

plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"
    defaultConfig {
        applicationId "com.something.sampleapp"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }

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

dependencies {
    compile fileTree(include: '*.jar', dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.android.support:design:23.4.0'
    compile 'com.mcxiaoke.volley:library-aar:1.0.0'
    compile 'com.google.android.gms:play-services:9.0.1'
}
Sidharth
  • 79
  • 1
  • 2
  • 9

3 Answers3

1

i had the same problem that is caused by Firebase when tested under API 23. check out the link :

Getting Exception java.lang.NoClassDefFoundError: com.google.firebase.FirebaseOptions after updating to the new firebase

Community
  • 1
  • 1
M.Waqas Pervez
  • 2,492
  • 2
  • 19
  • 33
0

Try this; I hope it helps you:

  1. Go to Settings
  2. Click on build, execution and deployment
  3. After that you find instant run click on that
  4. Uncheck the enable instant run to hot swap code/resource
Jonas Czech
  • 12,018
  • 6
  • 44
  • 65
Sabby
  • 403
  • 3
  • 15
0

check if you installed SDK 19 in your android studio, i had the same issue with api 17 and its solved after installing the SDK

Mohammed Riyadh
  • 883
  • 3
  • 11
  • 34