失败 [INSTALL_FAILED_OLDER_SDK] Android Studio [英] Failure [INSTALL_FAILED_OLDER_SDK] Android Studio

查看:46
本文介绍了失败 [INSTALL_FAILED_OLDER_SDK] Android Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Android 新手,我正在使用 Android Studio.我创建了一个新项目只是为了展示 Hello World!但由于此错误,我无法让它在 AVD 上运行:Failure [INSTALL_FAILED_OLDER_SDK].

I'm new to Android and I'm using the Android Studio. I've created a new project just to show the Hello World! but I can't get it working on the AVD because of this error: Failure [INSTALL_FAILED_OLDER_SDK].

我已经搜索过答案,我知道这与 build.gradle 和 minSdkVersion 有关,但任何答案都对我有用.

I already searched for the answer and I know it's something about the build.gradle and the minSdkVersion but any of the answers worked for me.

这是我的 AndroidManifest.xml :

This is my AndroidManifest.xml :

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.scoelli.test" >

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MyActivity"
            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>

这是我的 build.gradle :

And this is my build.gradle :

apply plugin: 'com.android.application'

android {
    compileSdkVersion 'android-L'
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "com.example.scoelli.test"
        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'])
}

我不仅希望得到答案,还希望得到解释.

I would appreciate not only the answer but the explanation.

谢谢!

推荐答案

除非您知道要在您的应用程序中使用 Android L 开发者预览版,否则不要使用它进行定位和编译.它在很大程度上仍然是一个预览版本,看起来好像针对预览版的应用程序和编译会导致任何非 L 设备出现此错误.

Unless you know you want to be using the Android L developer preview with your application, do not target and compile with it. It is still very much a preview release, and it appears as though applications targeting and compiling for the preview cause this error with any non-L device.

更新 build.gradle 中的这些行以坚持使用最新的稳定版本(Android 4.4,API 19):

Update these lines in your build.gradle to stick with the latest stable release (Android 4.4, API 19):

android {
    compileSdkVersion 19

    defaultConfig {
        targetSdkVersion 19
    }
}

这篇关于失败 [INSTALL_FAILED_OLDER_SDK] Android Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆