Crashlytics升级v2.0.0+,打包报错

一、升级
1.In your app’s root-level (project-level) build.gradle:

  • Replace Fabric’s Maven repository with Google’s Maven repository.
  • Replace the Fabric Gradle plugin with the Firebase Crashlytics Gradle plugin. If you’re using Android Studio 4.1 Canary, be sure to add the Crashlytics Gradle plugin version 2.0.0 or later.
buildscript {
  // ...

  repositories {
    // ...

    // Remove Fabric's Maven repository.
    // maven { url 'https://maven.fabric.io/public' }

    // 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.4'

    // Remove the Fabric Gradle plugin.
    // classpath 'io.fabric.tools:gradle:1.31.2'

    // Add the Crashlytics Gradle plugin (use v2.0.0+ if you built
    // your app with Android Studio 4.1).
    classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1'
  }
}

2.In your app-level build.gradle, replace the Fabric plugin with the Firebase Crashlytics plugin:

apply plugin: 'com.android.application'

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

// Remove the Fabric plugin.
// apply plugin: 'io.fabric'

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

3.Finally, add the Firebase Crashlytics SDK. In your app-level build.gradle, replace the legacy Fabric Crashlytics SDK with the new Firebase Crashlytics SDK. Make sure you add version 17.0.0 or later (beginning November 15, 2020, this is required for your crash reports to appear in the Firebase console).

Recommended: For an optimal experience with Firebase Crashlytics, we recommend also adding the Firebase SDK for Google Analytics to your app (make sure to add Version 17.2.3 or later in order to get real time crash-free users and breadcrumbs).

dependencies {
  // Remove the Fabric Crashlytics SDK.
  // implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1' 

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

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

官网:https://firebase.google.cn/docs/crashlytics/upgrade-sdk?platform=android

二、打包报错
Execution failed for task ‘:app:uploadCrashlyticsMappingFileRelease’.
org.apache.http.conn.HttpHostConnectException: Connect to firebasecrashlyticssymbols.googleapis.com:443 [firebasecrashlyticssymbols.googleapis.com/216.58.200.42] failed: Connection timed out: connect

科学上网后,在gradle.properties中添加:

systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=xxxx // 端口
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值