Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
479 views
in Technique[技术] by (71.8m points)

android - Installation failed since app's minSdkVersion is newer than device's API level

Here is my gradle settings.

ext {
    android_compile_version = 26
    android_version = '26.0.1'
    android_min_sdk_version =15

    appcompat_library_version = '25.2.0'
    support_library_version = '25.2.0'
    gms_library_version = '11.0.4'
}

this is define in my project.gradle file and

apply plugin: 'com.android.application'

android {

    compileSdkVersion android_compile_version
    buildToolsVersion android_version

defaultConfig {

    applicationId "com.xxasda.stickman"

    minSdkVersion android_min_sdk_version
    targetSdkVersion compileSdkVersion
    versionCode 2
    versionName "1.1"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}
}

dependencies {
    compile "com.android.support:appcompat-v7:${appcompat_library_version}"
    compile "com.android.support:support-v4:${support_library_version}"
    compile project(':libraries:BaseGameUtils')
}

buildscript {
    repositories {
        jcenter()
    }
}

This is my Build.Gradle file I don't know why it's not compiling. but when I try to run application on emulator it throws me this error

Failure [INSTALL_FAILED_OLDER_SDK]


Installation failed since app's minSdkVersion is newer than device's API level (API 23).
Please update your apps minSdkVersion.
Error while Installing APK

I checked many times and replace min_sdk_version with absolute value 15 but still no luck.any one please advice it would be helpful.

Thank you. :)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I'm also getting same issue

I have solved my issue making below changes

compileSdkVersion 'android-P'
targetSdkVersion 27

and the dependencies

implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
implementation 'com.android.support:design:28.0.0-alpha1'
implementation 'com.android.support:support-v4:28.0.0-alpha1'
implementation 'com.android.support:cardview-v7:28.0.0-alpha1'

hope it help someone


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...