【使用firebase crashlytics对c层代码进行字符上传】
使用firebase crashlytics对c层代码进行字符上传
此处使用kts语言
首先确认crashlytics版本,我自己用的2.9.9,测试中发现用3.0.0不生效
然后在buildTypes中加入
buildTypes {getByName("release") {// Add this extensionconfigure<CrashlyticsExtension> {// 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 = truemappingFileUploadEnabled = trueunstrippedNativeLibsDir ="build/intermediates/merged_native_libs/googleplayRelease/mergeGoogleplayReleaseNativeLibs/out/lib"}}}
然后加入
<string name="com.crashlytics.android.build_id">1</string>
由于工程需要java17,所以切换环境变量
export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"
然后执行上传命令
./gradlew app:assembleDebug app:uploadCrashlyticsSymbolFileGoogleplayRelease -debug | grep "\[com.google.firebase.crashlytics\]"
大功告成