【发布时间】:2017-09-01 12:55:33
【问题描述】:
添加Android Facebook SDK依赖后
compile 'com.facebook.android:facebook-android-sdk:4.21.0'
我遇到了错误
compile 'com.android.support:appcompat-v7:25.3.1'
但项目运行良好。
所有 com.android.support 库必须使用完全相同的版本 规范(混合版本可能导致运行时崩溃)。成立 版本 25.3.1、25.0.0。例子包括 com.android.support:animated-vector-drawable:25.3.1 和 com.android.support:cardview-v7:25.0.0 少... (Ctrl+F1)
有一些库或工具和库的组合, 不兼容,或者可能导致错误。一种这样的不兼容性是 使用不支持的 Android 支持库版本进行编译 最新版本(或者特别是低于您的 targetSdkVersion。)
Build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
repositories {
mavenCentral()
}
defaultConfig {
applicationId "sujeet.raj.com"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
testCompile 'junit:junit:4.12'
compile 'com.facebook.android:facebook-android-sdk:4.21.0'
}
【问题讨论】:
-
compile 'com.android.support:cardview-v7:25.3.1' compile 'com.android.support:customtabs:25.3.1' 添加这两行
-
这是一个警告。降级
compile 'com.android.support:appcompat-v7:25.2.0' -
是的@AwaisMajeed,项目运行良好。
标签: android sdk dependencies build.gradle facebook-sdk-4.0