Android的工作室:失败[INSTALL_FAILED_OLDER_SDK]工作室、Android、INSTALL_FAILED_OLDER_SDK

2023-09-12 00:31:21 作者:旧城已成空。

今天,我已经下载了Android的工作室v 0.8.0测试版。我想,以测试SDK 17我的应用程序。 Android的工作室误差失败[INSTALL_FAILED_OLDER_SDK] 这是我的Andr​​oid清单

 < XML版本=1.0编码=UTF-8&GT?;
<舱单的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    包=com.vahe_muradyan.notes>
    <应用
        机器人:allowBackup =真
        机器人:图标=@可绘制/ ic_launcher
        机器人:标签=@字符串/ APP_NAME
        机器人:主题=@风格/ AppTheme>
        <活动
            机器人:名称=。Main_Activity
            机器人:标签=@字符串/ APP_NAME>
            <意向滤光器>
                <作用机器人:名称=android.intent.action.MAIN/>

                <类机器人:名称=android.intent.category.LAUNCHER/>
            &所述; /意图滤光器>
        < /活性GT;
    < /用途>

< /舱单>
 

看来,机器人工作室采用配置在build.gradle.Here是build.gradle

 应用插件:com.android.application

安卓{
    compileSdkVersion'L'
    buildToolsVersion20.0.0

    defaultConfig {
        的applicationIDcom.vahe_muradyan.notes
        的minSdkVersion 8
        targetSdkVersion'L'
        版本code 1
        VERSIONNAME1.0
    }
    buildTypes {
        推出 {
            runProguard假
            proguardFiles getDefaultProguardFile('ProGuard的-android.txt'),'proguard-rules.pro
        }
    }
}

依赖{
    编译文件树(导演:库,包括:['的* .jar'])
    编译com.android.support:appcompat-v7:19.+
}
 

解决方案 Android Studio调试手机或者安装APK的时候出现install failed test only

有我的配置,以支持Android的L和旧版本:

 应用插件:com.android.application

安卓{
    buildToolsVersion20.0.0

    defaultConfig {
        的applicationIDcom.example.uladzimir_klyshevich.myapplication
        版本code 1
        VERSIONNAME1.0
    }
    buildTypes {
        推出 {
            runProguard假
            proguardFiles getDefaultProguardFile('ProGuard的-android.txt'),'proguard-rules.pro
        }
    }


    productFlavors {
        L {多
            的minSdkVersion机器人-L'
            targetSdkVersion机器人-L'
            compileSdkVersion机器人-L'
        }
        旧 {
            的minSdkVersion 10
            targetSdkVersion 20
            // TODO注释第二行,如果构建没有编译为L
            compileSdkVersion 20
        }
    }
}

依赖{
    编译文件树(导演:库,包括:['的* .jar'])
    lCompilecom.android.support:appcompat-v7:21.+
    oldCompilecom.android.support:appcompat-v7:19.1.0
}
 

作为结果,你将有味道:

oldDebug oldRelease lDebug lrelease,即可

和可以在旧版本的Andr​​oid应用程序安装。

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.