Android Studio-INSTALL_FAILED_OLDER_SDK

时间:2014-08-02 16:51:17

标签: android android-studio

在Android工作室bulid成功但在运行项目时我收到以下错误 -

pkg:/data/local/tmp/com.facebooklogin 失败[INSTALL_FAILED_OLDER_SDK]

我正在尝试在我的手机中运行具有API 16的项目

我的build.gradle文件是 -

apply plugin: 'com.android.library'
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.12.+'
    }
}

android {
    compileSdkVersion 19
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "com.facebook.android"
        minSdkVersion 14
        targetSdkVersion 19
    }


    dependencies {
        compile 'com.android.support:support-v4:20.0.0'
        compile files('libs/bolts.jar')

    }
}

另一个build.gradle文件是 -

apply plugin: 'android'

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

    defaultConfig {
        applicationId "com.facebooklogin"
        minSdkVersion 14
        targetSdkVersion 18
    }

    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile project(':facebookSDK')
    compile 'com.android.support:support-v4:20.0.0'
    compile 'com.android.support:appcompat-v7:+'

}

和AnroidManifest.xml是 -

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

    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="19" />
    <uses-permission android:name="android.permission.INTERNET"/>
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
        <activity
            android:name="info.androidhive.google.SplashScreen"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
          <activity
            android:name="info.androidhive.google.ViewFlipperSampleActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="info.androidhive.google.MainFragment"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="info.androidhive.google.MainActivity"
            android:label="@string/app_name" >

        </activity>
        <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/app_id"/>
        <activity android:label="@string/app_name" android:name="com.facebook.LoginActivity"></activity>
        <activity
            android:name="info.androidhive.google.slidingmenu.SlidingMenu"
            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>

1 个答案:

答案 0 :(得分:2)

您的设备是与Jelly Bean相对应的API 16。您的build.gradle文件具有以下语句

android {
    compileSdkVersion 'android-L'

尝试更改为与您的设备兼容的版本或将您的设备升级到更高的API级别。