“失败[INSTALL_FAILED_OLDER_SDK]”在Android Studio中是什么意思?

时间:2021-04-10 17:02:57

I got this Froyo (2.2) device that I am using to make an app. When I try to run the app directly to the device it shows an error saying

我使用了这个Froyo(2.2)设备来制作一个应用程序,当我试图直接运行这个应用程序时,它会显示一个错误。

pkg: /data/local/tmp/com.example.HelloWorldProject
Failure [INSTALL_FAILED_OLDER_SDK]

and in another window there's an error saying

在另一个窗口中有一个错误。

Unable to attach test reporter to test framework or test framework quit unexpectedly

What seem to make the said errors?

是什么使上述错误发生?

EDIT:

编辑:

AndroidManifest.xml

AndroidManifest.xml

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

    <uses-sdk
            android:minSdkVersion="8"
            android:targetSdkVersion="17"/>

    <application
            android:allowBackup="true"
            android:debuggable="true"
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name"
            >
        <activity
                android:name="com.example.HelloWorldProject.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>

14 个解决方案

#1


24  

After I changed

当我改变了

defaultConfig {
    applicationId "com.example.bocheng.myapplication"
    minSdkVersion 15
    targetSdkVersion 'L' #change this to 19
    versionCode 1
    versionName "1.0"
}

in build.gradle file.

在构建。gradle文件。

it works

它的工作原理

#2


20  

This error

这个错误

Failure [INSTALL_FAILED_OLDER_SDK]

Means that you're trying to install an app that has a higher minSdkVersion specified in its manifest than the device's API level. Change that number to 8 and it should work. I'm not sure about the other error, but it may be related to this one.

这意味着您正在尝试安装一个应用程序,该应用程序在其清单中指定的minSdkVersion比设备的API级别更高。把这个数改成8,就可以了。我不确定另一个错误,但它可能与这个有关。

#3


10  

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. In Android Studio klick on Tools -> Android -> SDK Manager. Then install at minimum (for Android 2.2 without emulator):

除了在build中检查正确的minSdkVersion。gradle,确保你在SDK管理器中安装了所有必要的工具和正确的SDK平台。在Android Studio klick的工具-> Android -> SDK管理器。然后至少安装(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)
    • SDK Platform
    • SDK平台
    • Google APIs
    • 谷歌api
  • Android 2.2 (API 8) SDK平台谷歌API。

This is what worked for me.

这就是我的工作。

#4


4  

Make sure you don't have a minSdkVersion set in your build.gradle with a value higher than 8. If you don't specify it at all, it's supposed to use the value in your AndroidManfiest.xml, which seems to already be properly set.

确保在构建中没有设置minSdkVersion。值大于8的等级。如果你不指定它,它应该在你的AndroidManfiest中使用这个值。xml似乎已经设置好了。

#5


3  

Just removing uses-sdk tag works for me for such problems.

仅仅移除uses-sdk标签对我来说是很有用的。

#6


1  

Failure [INSTALL_FAILED_OLDER_SDK] basically means that the installation has failed due to the target location (AVD/Device) having an older SDK version than the targetSdkVersion specified in your app.

失败[INSTALL_FAILED_OLDER_SDK]基本上意味着安装失败,因为目标位置(AVD/Device)有一个较老的SDK版本,而不是应用程序中指定的targetSdkVersion。

N/B Froyo 2.2 API 8

N/B Froyo 2.2 API 8。

To fix this simply change

要解决这个简单的变化。

targetSdkVersion="17" to targetSdkVersion="8"

targetSdkVersion = targetSdkVersion“17”=“8”

cheers.

欢呼。

#7


1  

Make Sure the Select Run/Debug Configuration is wear or mobile as per your installation in android studio...

确保在android studio中,选择运行/调试配置是wear或mobile。

#8


1  

Failure [INSTALL_FAILED_OLDER_SDK]

失败(INSTALL_FAILED_OLDER_SDK)

For Sumsung note3 I just edit the AndroidManifest.xml file and add the following code:

对于Sumsung note3,我只编辑AndroidManifest。xml文件并添加以下代码:

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17"/>

#9


0  

In your manifest file package attribute is set to com.test.helloworld however your activity class is under different package. Change your MyActivity class package to com.example.helloworld

在您的manifest文件包属性中设置为com.test。但是,您的活动类在不同的包中。将您的MyActivity类包更改为com.example.helloworld。

#10


0  

This is because you mobile has older sdk version than your application..!!! It means your application need sdk version suppose Lollipop but you mobile has version kitkat.

这是因为您移动的sdk版本比您的应用程序更早!!!这意味着您的应用程序需要sdk版本,假设是Lollipop,但您的移动版本是kitkat。

#11


0  

Fix your gradle file the following way

按照以下方式修复您的gradle文件。

defaultConfig {
    applicationId "package.com.app"
    minSdkVersion 8 //this should be lower than your device
    targetSdkVersion 21
    versionCode 1
    versionName "1.0"
}

#12


0  

In android studio: reduce minSDKversion. It will work...

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "healthcare.acceliant.trianz.com.myapplication"
        minSdkVersion 11
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.1.1'
}

#13


0  

I fixed this problem.The device system version is older then the sdk minSdkVersion。 I just modified the minSdkVersion from android_L to 19 to target my nexus 4.4.4.

我修复这个问题。设备系统版本比sdk minSdkVersion更早,我刚刚修改了从android_L到19的minSdkVersion,目标是我的nexus 4.4.4。

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.12.2'
    }
}
apply plugin: 'com.android.application'

repositories {
    jcenter()
}

android {
    **compileSdkVersion 'android-L'** modified to 19
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "com.antwei.uiframework.ui"
        minSdkVersion 14
        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:support-v4:21.+'** modified to compile 'com.android.support:support-v4:20.0.0'
}

how to modified the value by ide. select file->Project Structure -> Facets -> android-gradle and then modified the compile Sdk Version from android_L to 19

如何通过ide修改该值。选择file->项目结构-> facet -> android-gradle,然后从android_L修改编译Sdk版本到19。

sorry I don't have enough reputation to add pictures

对不起,我没有足够的名气来添加图片。

#14


-1  

Change file AndroidManifest.xml

更改文件AndroidManifest.xml

<uses-sdk android:minSdkVersion="19"/>

<uses-sdk android:minSdkVersion="14"/>

#1


24  

After I changed

当我改变了

defaultConfig {
    applicationId "com.example.bocheng.myapplication"
    minSdkVersion 15
    targetSdkVersion 'L' #change this to 19
    versionCode 1
    versionName "1.0"
}

in build.gradle file.

在构建。gradle文件。

it works

它的工作原理

#2


20  

This error

这个错误

Failure [INSTALL_FAILED_OLDER_SDK]

Means that you're trying to install an app that has a higher minSdkVersion specified in its manifest than the device's API level. Change that number to 8 and it should work. I'm not sure about the other error, but it may be related to this one.

这意味着您正在尝试安装一个应用程序,该应用程序在其清单中指定的minSdkVersion比设备的API级别更高。把这个数改成8,就可以了。我不确定另一个错误,但它可能与这个有关。

#3


10  

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. In Android Studio klick on Tools -> Android -> SDK Manager. Then install at minimum (for Android 2.2 without emulator):

除了在build中检查正确的minSdkVersion。gradle,确保你在SDK管理器中安装了所有必要的工具和正确的SDK平台。在Android Studio klick的工具-> Android -> SDK管理器。然后至少安装(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)
    • SDK Platform
    • SDK平台
    • Google APIs
    • 谷歌api
  • Android 2.2 (API 8) SDK平台谷歌API。

This is what worked for me.

这就是我的工作。

#4


4  

Make sure you don't have a minSdkVersion set in your build.gradle with a value higher than 8. If you don't specify it at all, it's supposed to use the value in your AndroidManfiest.xml, which seems to already be properly set.

确保在构建中没有设置minSdkVersion。值大于8的等级。如果你不指定它,它应该在你的AndroidManfiest中使用这个值。xml似乎已经设置好了。

#5


3  

Just removing uses-sdk tag works for me for such problems.

仅仅移除uses-sdk标签对我来说是很有用的。

#6


1  

Failure [INSTALL_FAILED_OLDER_SDK] basically means that the installation has failed due to the target location (AVD/Device) having an older SDK version than the targetSdkVersion specified in your app.

失败[INSTALL_FAILED_OLDER_SDK]基本上意味着安装失败,因为目标位置(AVD/Device)有一个较老的SDK版本,而不是应用程序中指定的targetSdkVersion。

N/B Froyo 2.2 API 8

N/B Froyo 2.2 API 8。

To fix this simply change

要解决这个简单的变化。

targetSdkVersion="17" to targetSdkVersion="8"

targetSdkVersion = targetSdkVersion“17”=“8”

cheers.

欢呼。

#7


1  

Make Sure the Select Run/Debug Configuration is wear or mobile as per your installation in android studio...

确保在android studio中,选择运行/调试配置是wear或mobile。

#8


1  

Failure [INSTALL_FAILED_OLDER_SDK]

失败(INSTALL_FAILED_OLDER_SDK)

For Sumsung note3 I just edit the AndroidManifest.xml file and add the following code:

对于Sumsung note3,我只编辑AndroidManifest。xml文件并添加以下代码:

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17"/>

#9


0  

In your manifest file package attribute is set to com.test.helloworld however your activity class is under different package. Change your MyActivity class package to com.example.helloworld

在您的manifest文件包属性中设置为com.test。但是,您的活动类在不同的包中。将您的MyActivity类包更改为com.example.helloworld。

#10


0  

This is because you mobile has older sdk version than your application..!!! It means your application need sdk version suppose Lollipop but you mobile has version kitkat.

这是因为您移动的sdk版本比您的应用程序更早!!!这意味着您的应用程序需要sdk版本,假设是Lollipop,但您的移动版本是kitkat。

#11


0  

Fix your gradle file the following way

按照以下方式修复您的gradle文件。

defaultConfig {
    applicationId "package.com.app"
    minSdkVersion 8 //this should be lower than your device
    targetSdkVersion 21
    versionCode 1
    versionName "1.0"
}

#12


0  

In android studio: reduce minSDKversion. It will work...

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "healthcare.acceliant.trianz.com.myapplication"
        minSdkVersion 11
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.1.1'
}

#13


0  

I fixed this problem.The device system version is older then the sdk minSdkVersion。 I just modified the minSdkVersion from android_L to 19 to target my nexus 4.4.4.

我修复这个问题。设备系统版本比sdk minSdkVersion更早,我刚刚修改了从android_L到19的minSdkVersion,目标是我的nexus 4.4.4。

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.12.2'
    }
}
apply plugin: 'com.android.application'

repositories {
    jcenter()
}

android {
    **compileSdkVersion 'android-L'** modified to 19
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "com.antwei.uiframework.ui"
        minSdkVersion 14
        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:support-v4:21.+'** modified to compile 'com.android.support:support-v4:20.0.0'
}

how to modified the value by ide. select file->Project Structure -> Facets -> android-gradle and then modified the compile Sdk Version from android_L to 19

如何通过ide修改该值。选择file->项目结构-> facet -> android-gradle,然后从android_L修改编译Sdk版本到19。

sorry I don't have enough reputation to add pictures

对不起,我没有足够的名气来添加图片。

#14


-1  

Change file AndroidManifest.xml

更改文件AndroidManifest.xml

<uses-sdk android:minSdkVersion="19"/>

<uses-sdk android:minSdkVersion="14"/>