【问题标题】:How can I resolve this build error when adding facebook sdk添加 facebook sdk 时如何解决此构建错误
【发布时间】:2017-02-26 18:02:09
【问题描述】:

我在 Android Studio 中不断收到 BUILD FAILED,并且我之前已经解决了其他类似的错误,但这一个很难。基本上我所做的是将quickstart-android-auth 添加到现有的工作Android 项目中。

在我添加 quickstart-android-auth 文件和独立文件之前,一切正常。

错误:任务 ':app:processDebugManifest' 执行失败。

清单合并失败:uses-sdk:minSdkVersion 14 不能小于库中声明的版本 15 [com.facebook.android:facebook-android-sdk:4.16.0] D:\AndroidStudioProjects\Nogget\app\build\intermediates\exploded-aar\com.facebook.android\facebook-android-sdk\4.16.0\AndroidManifest.xml 建议:使用 tools:overrideLibrary="com.facebook" 强制使用

这是我的 Build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion '24.0.2'

    dexOptions {
        dexInProcess = true
    }

    defaultConfig {
        applicationId "com.port.android"
        minSdkVersion 14
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    repositories {
        maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
        mavenCentral()
    }

    packagingOptions{
        exclude 'META-INF/LICENSE'
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.volley:volley:1.0.0'
    compile 'com.android.support:support-compat:24.2.0'
    compile 'com.google.android.gms:play-services:9.6.0'
    compile 'com.android.support:support-v13:24.2.0'
    compile "com.google.firebase:firebase-messaging:9.0.0"
    compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
    compile 'com.google.code.gson:gson:2.4'
    compile 'com.android.support:design:24.2.0'
    compile 'de.hdodenhof:circleimageview:1.3.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.android.support:percent:24.2.0'
    compile 'me.grantland:autofittextview:0.2.+'
    compile 'com.google.firebase:firebase-auth:9.2.1'
    compile 'com.google.firebase:firebase-messaging:9.2.1'
    compile 'com.google.android.gms:play-services-appinvite:9.6.0'
    compile 'com.google.firebase:firebase-analytics:9.2.1'
    compile 'com.google.firebase:firebase-crash:9.6.0'
    compile 'com.google.android.gms:play-services-ads:9.6.0'
    compile 'com.github.bmelnychuk:atv:1.2.+'
    compile 'com.github.johnkil.print:print:1.2.2'
    testCompile 'junit:junit:4.12'
    compile 'com.seatgeek:placesautocomplete:0.2-SNAPSHOT'
    compile 'com.fasterxml.jackson.core:jackson-core:2.7.2'
    compile 'com.fasterxml.jackson.core:jackson-annotations:2.7.2'
    compile 'com.fasterxml.jackson.core:jackson-databind:2.7.2'
    compile 'com.facebook.android:facebook-android-sdk:4.16.0'
    compile('com.twitter.sdk.android:twitter-core:1.6.6@aar') {
        transitive = true
    }
    compile('com.twitter.sdk.android:twitter:1.13.1@aar') {
        transitive = true;
    }
}
apply plugin: 'com.google.gms.google-services'

【问题讨论】:

    标签: android facebook-sdk-4.0 build-error


    【解决方案1】:

    正如错误所说,您的 minSDK 是 14,但最新的 FacebookSDK 需要 mins SDK 15。增加您的 minSDK 应该可以解决您的问题

    【讨论】:

      【解决方案2】:

      将 minSdkVersion 更改为 15 而不是 14。
      Facebook 库需要 api 15。所以您的项目不能将 minsdkversion 设置为 14...

      【讨论】:

        【解决方案3】:

        将 build.gradle 中的 minSdk 设置为 15,因为 facebook 支持 API 15。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2021-08-20
          • 2018-03-26
          • 2017-03-30
          • 1970-01-01
          • 2019-02-21
          相关资源
          最近更新 更多