Android Firebase 符号表上传

用过firebase崩溃收集的应该都知道底层崩溃信息中如果没有通过符号表解析的话是很难确定崩溃位置的,那么firebase中该如何上传符号表呢?

一. Firebase 集成

1.前提条件:需要集成firebase Crashlytics ndk的库

dependencies {
    ......
 
    implementation 'com.google.firebase:firebase-crashlytics-ndk'
    
}

2.集成流程
Firebase:https://firebase.google.com/docs/crashlytics/ndk-reports

build.gradle(app):

plugins {
    id 'com.android.application'
 
    // Make sure that you have the Google services Gradle plugin
    id 'com.google.gms.google-services'
 
    // Add the Crashlytics Gradle plugin
    id 'com.google.firebase.crashlytics'
    ...
}
 
 
// ...
 
android {
  // ...
  buildTypes {
      release {
          // Add this extension
          firebaseCrashlytics {
              // Enable processing and uploading of native symbols to Firebase servers.
              // By default, this is disabled to improve build speeds.
              // This flag must be enabled to see properly-symbolicated native
              // stack traces in the Crashlytics dashboard.
              nativeSymbolUploadEnabled true
              strippedNativeLibsDir 'build/intermediates/stripped_native_libs/debug/out/lib'
          }
      }
  }
}
 
 
 
 
 
dependencies {
    // Add the dependencies for the Crashlytics NDK and Analytics libraries
    // When NOT using the BoM, you must specify versions in Firebase library dependencies
    implementation 'com.google.firebase:firebase-crashlytics-ndk:18.3.2'
    implementation 'com.google.firebase:firebase-analytics:21.2.0'
}

build.gradle(project):

buildscript {
    repositories {
      // Make sure that you have the following two repositories
      google()  // Google's Maven repository
      mavenCentral()  // Maven Central repository
    }
 
    dependencies {
        ...
        
 
        // Make sure that you have the Google services Gradle plugin dependency
        classpath 'com.google.gms:google-services:4.3.14'
 
        // Add the dependency for the Crashlytics Gradle plugin
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
    }
}

二、自动上传符号表

在AS terminal中输入以下命令上传符号表,此方式依赖gradle

debug:./gradlew app:assembleDebug app:uploadCrashlyticsSymbolFileDebug -debug
 
release:./gradlew app:assembleRelease app:uploadCrashlyticsSymbolFileRelease

三、手动上传符号表

1.下载安装 Firebase CLI:https://firebase.google.com/docs/cli
2.运行CLI 并登录firebase账号,注:打开后如果没有登录过会自动打开浏览器让你登录账号
3.输入命令上传符号表

firebase crashlytics:symbols:upload --app=FIREBASE_APP_ID PATH/TO/SYMBOLS
 
 
FIREBASE_APP_ID :您的 Firebase Android 应用 ID(不是您的包名称)
示例 Firebase Android 应用程序 ID1:567383******:android:17104a2********
 
 
PATH/TO/SYMBOLS : CLI 生成的符号文件的路径
导出到 Android Studio 项目 — PATH/TO/SYMBOLS可以是任何目录。 Firebase CLI 将递归地在指定目录中搜索扩展名为.so的本机库。
直接从 Unity 中构建 APKPATH/TO/SYMBOLS是构建完成后在项目根目录中生成的压缩符号文件的路径(例如: myproject/myapp-1.0-v100.symbols.zip )。

在这里插入图片描述

在这里插入图片描述
至此,firebase符号表上传就完成了,这样就可以在firebase中查看到底层的具体崩溃信息了~~

  • 6
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值