【问题标题】:Can't build android app with crashlytics无法使用 crashlytics 构建 android 应用
【发布时间】:2016-05-28 12:23:53
【问题描述】:

我正在尝试在 Android 应用中从 crashlytics 1.x 升级到 Fabric。我已修改 build.gradle 文件以匹配此处的示例 - https://fabric.io/downloads/gradle

但是在构建时我得到 - 错误:无法解决:com.crashlytics.sdk.android:crashlytics:2.5.5

我使用的是 Android Studio 1.5.1,并且安装了 Fabric 插件。我还需要做什么?

buildscript {
    repositories {
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
        maven { url 'http://repository-nutiteq.forge.cloudbees.com/release/' }

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'
        classpath 'io.fabric.tools:gradle:1.+'
    }
}

apply plugin: 'com.android.library'
apply plugin: 'io.fabric'


android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"
    useLibrary  'org.apache.http.legacy'

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 23
        multiDexEnabled true
    }


    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

    dexOptions {
        jumboMode = true
    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/ASL2.0'
        exclude 'META-INF/maven/com.squareup.okhttp/okhttp/pom.properties'
    }


}

repositories {
    jcenter()
    maven { url 'https://maven.fabric.io/public' }
    maven { url 'http://repository-nutiteq.forge.cloudbees.com/release/' }

}


dependencies {
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:recyclerview-v7:23.1.1'
    compile 'com.squareup.okhttp3:okhttp:3.1.2'
    compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
        transitive = true;
    }

    // some removed

}

【问题讨论】:

  • 请同时显示您的项目级 gradle 文件,而不仅仅是 app 文件夹中的那个
  • 来自 Fabric 的 Mike,如果你运行:./gradlew assemble --refresh-dependencies 有帮助吗?

标签: android crashlytics twitter-fabric crashlytics-android


【解决方案1】:

我遇到了同样的问题,通过添加解决了它

    allprojects {
     repositories {
         jcenter()
         mavenCentral()
         maven { url 'https://maven.fabric.io/public' }
     }
    }

在 build.gradle(项目)中

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-07
    • 1970-01-01
    • 2015-03-15
    相关资源
    最近更新 更多