【问题标题】:Build.gradle not syncing Android StudioBuild.gradle 不同步 Android Studio
【发布时间】:2017-08-19 06:34:16
【问题描述】:

我的 Android 应用的 build.gradle 文件中有以下依赖项。

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile files('libs/mxparser.jar')

    // View dependency injection library by Jake Wharton
    compile 'com.jakewharton:butterknife:8.5.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'

    // apt command comes from the android-apt plugin
    compile 'com.google.dagger:dagger:2.9'
    annotationProcessor "com.google.dagger:dagger-compiler:2.9"
    provided 'javax.annotation:jsr250-api:1.0'

    // Crash reporting SDK
    compile('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') {
        transitive = true;
    }
}

但是,当我将 Crashlytics 添加为依赖项时,我收到以下错误:

Error:Failed to resolve: annotationProcessor
Failed to resolve: com.crashlytics.sdk.android:crashlytics:2.6.7

项目构建.gradle:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.0'
        classpath 'com.jakewharton:butterknife-gradle-plugin:8.5.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

【问题讨论】:

    标签: android android-gradle-plugin build.gradle google-fabric crashlytics-android


    【解决方案1】:

    确保你已经添加了

    apply plugin: 'io.fabric'
    
    repositories {
      maven { url 'https://maven.fabric.io/public' }
    }
    

    添加到您应用的 build.gradle 文件中,否则 Crashlytics 将无法解析并给出奇怪的错误。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-03
      • 2021-02-20
      • 2018-12-08
      • 2022-06-30
      • 1970-01-01
      • 2016-01-01
      相关资源
      最近更新 更多