Android Studio-INSTALL\u失败\u旧版\u SDK
在androidstudio中,bulid是成功的,但是在运行项目时,我得到了以下错误- pkg:/data/local/tmp/com.facebook登录 失败[安装\u失败\u旧的\u SDK] 我正在尝试在我的手机上运行一个API为16的项目 我的build.gradle文件是-Android Studio-INSTALL\u失败\u旧版\u SDK,android,android-studio,Android,Android Studio,在androidstudio中,bulid是成功的,但是在运行项目时,我得到了以下错误- pkg:/data/local/tmp/com.facebook登录 失败[安装\u失败\u旧的\u SDK] 我正在尝试在我的手机上运行一个API为16的项目 我的build.gradle文件是- apply plugin: 'com.android.library' buildscript { repositories { mavenCentral() } dep
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')
}
}
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:+'
}
另一个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')
}
}
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>
您的设备是API 16,对应于果冻豆。build.gradle文件具有以下语句
android {
compileSdkVersion 'android-L'
尝试更改为与您的设备兼容的版本,或将您的设备升级到更高的API级别。我尝试了在此处标记的副本中给出的解决方案。可能的副本还包括删除compile'com.android.support:appcompat-v7:+'并使用compile'com.android.support:appcompat-v7:19.1.0'但不包括minSdkVersion 14。为什么它没有安装在API 16上