I'm kind of new to Android development, and I think I may have made a mistake. I've been working with compileSdkVersion 25
in my build.gradle file. But I want my application to be supported for Android 4.1 and higher.
However, when I run my application on a Android 4.1 system, it will immediately shut down (I guess because it's not supported).
I tried to change the compileSdkVersion 25
to compileSdkVersion 16
, but this will give a lot of errors (and I know why). It's kind of annoying to start changing every little thing which is not supported in Android 4.1, so..
Question: What is the correct way to downgrade your Android application?
Current build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "xxxx"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
resValue "string", "google_maps_key", (project.findProperty("GOOGLE_MAPS_API_KEY") ?: "")
multiDexEnabled true
useLibrary 'org.apache.http.legacy'
}
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.android.support:appcompat-v7:25.2.0'
compile 'com.google.android.gms:play-services:9.8.0'
compile 'com.google.firebase:firebase-core:9.8.0'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:25.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.1'
}