0

I have my minSdkVersion set to 21 but my app fails to run on other other versions except 7.* To be detailed the app successfully installs and runs perfectly on Nougat based ROMs (API level 24 and 25) but on ROMs based on API 23 or below the apk simple doesnt installs. It just says app not installed. :(

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "26.0.0"
    defaultConfig {
        applicationId "com.rishav.t2"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 1
        versionName "0.2"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.jakewharton:butterknife:8.6.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
    compile 'com.android.support:design:25.4.0'
    compile 'com.android.support:appcompat-v7:25.3.1'
    implementation 'com.android.support:support-v4:25.4.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'
    compile 'com.google.firebase:firebase-auth:11.0.1'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.firebase:firebase-database:11.0.1'
}




apply plugin: 'com.google.gms.google-services'

Is it because my compileSdkVersion is set to Nougat?

Rishav
  • 3,818
  • 1
  • 31
  • 49
  • Use LogCat to examine the Java stack trace associated with your crash: https://stackoverflow.com/q/23353173/115145 Given a `build.gradle` file and nothing else, nobody can tell you why you are crashing. – CommonsWare Jun 21 '17 at 18:25
  • @CommonsWare Sure I will. But is there a problem with my build.gradle anyways? – Rishav Jun 21 '17 at 18:26
  • If you have any doubt, why don't to try changing it? – Daksh Gargas Jun 21 '17 at 18:26
  • @Dennis Change what to what exactly? – Rishav Jun 21 '17 at 18:27
  • change the `compileSdkVersion` – Daksh Gargas Jun 21 '17 at 18:29
  • "But is there a problem with my build.gradle anyways?" -- how can we tell? We do not know what the problem is. Your question is akin to you going to the doctor, saying "I do not feel well", pointing to your foot... and then not providing the doctor with any more information. The doctor has no idea what your issue is, let alone whether your foot is part of the problem. If you want help, you need to provide *actual details* of the *actual problem*, not vague statements like "fails to run". – CommonsWare Jun 21 '17 at 18:31
  • @CommonsWare Fine ill edit.. – Rishav Jun 21 '17 at 18:33

1 Answers1

0

Your targetSDKVersion and compileSDKVersion have to match. Make sure you have Android SDK Platform 26 downloaded

adao7000
  • 3,632
  • 2
  • 28
  • 37
  • Well i tried channging my *compileSDKVersion* to my *targetSDKVersion* same thing... And i have SDK 26 installed and runnig well and good. – Rishav Jun 21 '17 at 18:40