Suppenkasper Suppenkasper - 2 years ago 1883
Android Question

Android Studio - Unable to run app on device minSdk(API 23, N) != device Sdk(API 22)

so i reinstalled linux on my computer and after i reinstalled android studio i tried getting an app that i wrote on to my phone which previously had not been a problem. The App ist targeted at devices with API 16 or higher but apparently Android Studio now features something called N preview which does not let me run anything on my phone. specifically when i hit the run button it tells me that

minSdk(API 23, N) != device Sdk(API 22)

i know this seems as though the target API isnt set correctly but when i started the project i set it to 16. Now how do i get around this? Also whats the cleanest way to change the target API on a project? Do i just change the build gradle?

Thanks a lot!

app gradle file:

apply plugin: ''

android {
compileSdkVersion 'android-N'
buildToolsVersion "23.0.3"

defaultConfig {
applicationId "com.example.josias.myapplication"
minSdkVersion 16
targetSdkVersion 'N'
versionCode 1
versionName "1.0"
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), ''

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

enter image description here

Answer Source

Change compileSdkVersion 'android-N' to compileSdkVersion 22 and targetSdkVersion 'N' to targetSdkVersion 22

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download