can't test app on my mobile : Failure [INSTALL_FAILED_OLDER_SDK] - android

I am new to Android Studio and made an app but its not running on my physical device HTC one M8 giving and error like Failure [INSTALL_FAILED_OLDER_SDK]
htc one m8
android version: 5.0.2
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.example.darab.crazy_tip_calc"
minSdkVersion 22
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

Your device OS version is lower than you're app SDK version.
minSdkVersion 22
targetSdkVersion 22
Check your device version. I would suggest to set minSdkVersion to 15 or the the API level of your device. And this is 21 (5.0.2 of your M8).

Just set minSdkVersion 15 instead of 22
android:minSdkVersion
An integer designating the minimum API Level required for the application to run. The Android system will prevent the user from installing the application if the system's API Level is lower than the value specified in this attribute.
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.example.darab.crazy_tip_calc"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

Check your minSdk version and Target Sdk Version.

Related

SDK levels for lollipop

what are the best apk level to run a app in a android lollipop 5.1 version. Here is what I currently having
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.locationtracker2019"
minSdkVersion 19
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
As per your Question your application is running in the minSdkVersion means that your minimum version support your app.
targetSdkVersion is the main way Android provide forward compatibility not applying behavior change unless the targetSdkVersion is update.
It should be emphasized that changing your compileSdkVersion does not change runtime behavior. While new compiler errors/warnings may present when chang your compileSdkVersion, your compileSdkVersion is not included in your APK: it is purely used at compile time.
For more information about, What is API Level?
I hope it'll help you...!

I can't test on my smartphone

i was develop an smartphone game and when i test on android studio at AVD, it works, but when i test it at my device it just shut down and i don't know why it is.
i just want to look at log file but i can't find it.
android
{
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "seaweed.myapplication"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
i was test at AVD at api level 24, and my device's api level is 19.
so i think that it might happen because of api level but i can't realize it.

Android app not working in few mobiles

Recently I designed an app name "Country Wagon" and its in play store already these are my sdk setting's
android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
defaultConfig {
applicationId "xxxxxxxxxxxx.countrywagon"
minSdkVersion 18
targetSdkVersion 22
versionCode 1
versionName "1.0"
// Enabling multidex support.
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
but sadly its not supporting for mobiles like samsung s3 neo, HTC700 and these mobiles has the screen size below 5-inches.would that be a problem??. And the app is working pefectly fine for all the mobiles having display above 5inch
You need to change min sdk to 15 in your gradle file
minSdkVersion 15

Couldnt find target sdk with hash string 21 and also some classes are automatically omitted error

When I open one of my project then I find these problems of which I have taken some screenshot. Hope you can help me in solving it
and also when I open another project then the main activity was whole empty
And this is my sdk manager where I installed the required packages
The error is because API 21 is not installed.
Seems that you have to either install API 21 or change the compileSdkVersion to 23 and targetSdkVersion to 23 in the build.gradle(If you are using Android Studio), else check the same in AndroidManifest.xml file(Eclipse).
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
minSdkVersion 11
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
Couldnt find target sdk with hash string 21
An integer value that represents the version of the targetSdkVersion
An integer designating the API Level that the application targets
Update your SDK Manager
Improve your build.grale .
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
defaultConfig {
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "0.1.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
Then Clean-Rebuild-Restart-Sync .Hope this helps .

Android Gradle settings

I'm very confused with gradle versioning settings. I found some information about this build system, but nowhere was written about versioning details. Can you explain what these options mean?
compileSdkVersion
buildToolsVersion
minSdkVersion
targetSdkVersion
The minSdkVersion is most obvious, because it means the minimal API we want to support, e.g. 14 (Android >= 4.0).
The targetSdkVersion:
This attribute informs the system that you have tested against the target version and the system should not enable any compatibility behaviors to maintain your app's forward-compatibility with the target version.
I don't quite understand that.
My case is to support devices from API 15. What are the proper settings for that?
I read somewhere that target should be the highest as possible, Android Studio tells me that too, but when I set this up and try to run on Nexus 5 I get:
Failure [INSTALL_FAILED_OLDER_SDK]
My build.gradle
android {
compileSdkVersion 'android-L'
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "my.package.name"
minSdkVersion 14
targetSdkVersion 'L'
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
According to official doc:
http://developer.android.com/preview/setup-sdk.html#createProject
if you would like to try out new features you should use these values:
compileSdkVersion is set to 'android-L'
minSdkVersion is set to 'L'
targetSdkVersion is set to 'L'
It is the reason of Failure [INSTALL_FAILED_OLDER_SDK].
If you don't need android-L I suggest using these values:
defaultConfig {
applicationId "my.package.name"
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
Said that, there is an unofficial workaround described here (in any case I suggest that you don't use it)
Failure [INSTALL_FAILED_OLDER_SDK] Android-L

Categories

Resources