Today I have downloaded Android Studio v 0.8.0 beta. I am trying to test my app on SDK 17 . Android studio error Failure [INSTALL_FAILED_OLDER_SDK]
Here is my android manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.vahe_muradyan.notes" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".Main_Activity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
It seems that android studio uses configurations in build.gradle.Here is build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 'L'
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.vahe_muradyan.notes"
minSdkVersion 8
targetSdkVersion 'L'
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.+'
}
There are my config to support L and old versions of android:
apply plugin: 'com.android.application'
android {
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example.uladzimir_klyshevich.myapplication"
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
l {
minSdkVersion 'android-L'
targetSdkVersion 'android-L'
compileSdkVersion 'android-L'
}
old {
minSdkVersion 10
targetSdkVersion 20
//TODO comment second line if build is not compiles for "L"
compileSdkVersion 20
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
lCompile 'com.android.support:appcompat-v7:21.+'
oldCompile 'com.android.support:appcompat-v7:19.1.0'
}
As result you will have flavors:
oldDebug
oldRelease
lDebug
lRelease
And can install your application on old versions of android.
Do those changes in build.gradle
file in the wear module
compileSdkVersion 20
targetSdkVersion 20
So the final wear/build.gradle content will be:
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "your package name"
minSdkVersion 20
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.support:wearable:+'
compile 'com.google.android.gms:play-services-wearable:+'
}
I'm using Android Studio Beta version 0.8.1 and I have the same problem. I now I sold my problem by changing the AVD (I'm using Genymotion) to API 19. and here is my build.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "com.example.daroath.actionbar"
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
Hope this help!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With