简体   繁体   English

Android Studio失败错误[INSTALL_FAILED_OLDER_SDK]

[英]Error in Android Studio Failure [INSTALL_FAILED_OLDER_SDK]

Once I try to run my app in the emulator it sends me this error: 一旦我尝试在模拟器中运行我的应用程序,它将向我发送此错误:

pkg: /data/local/tmp/com.cerocerouno.safr.aplicacionmisteriosa
Failure [INSTALL_FAILED_OLDER_SDK]

I try creating another device, and when I run the new one, the same error appears. 我尝试创建另一台设备,然后在运行新设备时出现相同的错误。 And something else I notice that all the emulators have errors, when I touch the screen of any device I have created it collapses. 另外我注意到所有仿真器都有错误,当我触摸创建的任何设备的屏幕时,它都会崩溃。

This is my build.gradle file: 这是我的build.gradle文件:

apply plugin: 'com.android.application'

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

    defaultConfig {
        applicationId "com.cerocerouno.safr.aplicacionmisteriosa"
        minSdkVersion 7
        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'])
    compile 'com.android.support:appcompat-v7:19.+'
}

Besides checking the right minSdkVersion in build.gradle , make sure you have installed all necessary tools and correct SDK Platform for your preferred Android Version in SDK Manager. 除了在build.gradle检查正确的minSdkVersion build.gradle ,请确保已为SDK Manager中的首选Android版本安装了所有必需的工具和正确的SDK Platform In Android Studio klick on Tools -> Android -> SDK Manager . Android Studio中,点击Tools-> Android- > SDK Manager Then install at minimum (for Android 2.2 without emulator): 然后至少安装(对于没有模拟器的Android 2.2):

  • Android SDK Tools Android SDK工具
  • Android SDK Platform-tools Android SDK平台工具
  • Android SDK Build-tools (latest) Android SDK构建工具(最新)
  • Android 2.2 (API 8) Android 2.2(API 8)
  • SDK Platform SDK平台
  • Google APIs Google API

Also, Change targetSdkVersion 'L' to 19 in build.gradle file. 另外,在build.gradle文件targetSdkVersion 'L'更改为19

apply plugin: 'com.android.application'

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

    defaultConfig {
        applicationId "com.cerocerouno.safr.aplicacionmisteriosa"
        minSdkVersion 7
        targetSdkVersion 'L'  #change this to 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'])
    compile 'com.android.support:appcompat-v7:19.+'
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM