【问题标题】:Manifest merger fail while integrating firebase crashalytics 17.0.1集成 firebase crashlytics 17.0.1 时清单合并失败
【发布时间】:2020-09-30 15:53:15
【问题描述】:

我正在尝试将 firebase crashalytics 集成到现有的 android appcompat 应用中。我按照firebase的指示添加了依赖项,如下所示。

buildscript {
  // ...

  repositories {
    // ...

    // Add Google's Maven repository (if it's not there already).
    google()
  }

  dependencies {
    // ..

    // Add the Google Services Gradle plugin (if it's not there already).
    classpath 'com.google.gms:google-services:4.3.3'

    // Add the Firebase Crashlytics Gradle plugin.
    classpath 'com.google.firebase:firebase-crashlytics-gradle:2.1.1'
  }
}

build.gradle的插件下方添加

apply plugin: 'com.android.application'

// Apply the Google Services plugin (if it's not there already).
apply plugin: 'com.google.gms.google-services'

// Add the Firebase Crashlytics plugin.
apply plugin: 'com.google.firebase.crashlytics'

添加如下依赖

dependencies {

  // Add the Firebase Crashlytics SDK.
  implementation 'com.google.firebase:firebase-crashlytics:17.0.1'

  // Recommended: Add the Google Analytics SDK.
  implementation 'com.google.firebase:firebase-analytics:17.4.3'
}

但即使我添加了tools:replace="android:appComponentFactory",我也收到错误清单合并失败

清单合并失败:属性 application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) 来自 [com.android.support:support-compat:28.0.0],因为添加了 firebase crashalytics强>

【问题讨论】:

    标签: android firebase android-manifest firebase-crash-reporting manifest-merging


    【解决方案1】:

    1.在 Gradle.properties 文件中添加以下行:

    android.useAndroidX=true
    
    android.enableJetifier=true
    

    在文件 android/Gradle.properties 的底部

    如果第一个不工作,那么试试这个。

    2.换行

    implementation 
    "com.android.support:appcompatv7:${rootProject.ext.supportLibVersion}"
    

    implementation 'androidx.appcompat:appcompat:1.0.0'
    

    在android/app/build.gradle中

    希望对你有帮助)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-22
      • 1970-01-01
      • 1970-01-01
      • 2019-12-26
      • 2015-03-21
      • 1970-01-01
      相关资源
      最近更新 更多