天天看點

【Android】Bugly使用

建立産品

點選Bugly我的産品頁面,建立産品

​​​Bugly​​ 位址

內建SDK

在Module的build.gradle檔案中添加依賴和屬性配置:

dependencies {
    implementation 'com.tencent.bugly:crashreport:latest.release' //其中latest.release指代最新Bugly SDK版本号,也可以指定明确的版本号,例如4.0.3
}      

注意:4.0.0之前版本,還需要添加nativecrashreport依賴:

implementation 'com.tencent.rqd:nativecrashreport:latest.release' //其中latest.release指代最新Bugly NDK版本号,也可以指定明确的版本号,例如3.9.2      

參數配置

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />      

請避免混淆Bugly,在Proguard混淆檔案中增加以下配置:

-dontwarn com.tencent.bugly.**
-keep public class com.tencent.bugly.**{*;}      

簡單的初始化

CrashReport.initCrashReport(getApplicationContext(), "注冊時申請的APPID", false);      

參考demo ​​https://github.com/BuglyDevTeam/Bugly-Android-Demo​​

崩潰符号表上傳

崩在動态庫有些堆棧未解出無法判斷問題所在位置

未解出

【Android】Bugly使用

解出

【Android】Bugly使用

方式

符号表上傳工具位址:https://bugly.qq.com/v2/downloads

Java 符号表檔案上傳

java -jar buglyqq-upload-symbol.jar -appid $替換你的 -appkey $替換你的 -version 1.0.0 -bundleid com.inke.inf.kae -platform Android -u -inputMapping /Volumes/PSSD/mxz/inke-client/code.inke.cn/tpc/multimedia/client/universal_sdk/InkeTigerMedia/TigerMediaCoreRepos/TigerMediaCore/Modules/RTCZegoLiveRoom/RTCZegoLiveRoom.Android/RTCZegoLiveRoom/build/outputs/mapping/release/mapping.txt      

so符号表檔案

java -jar buglyqq-upload-symbol.jar -appid $替換你的 -appkey $替換你的 -version 1.0.0 -bundleid com.inke.inf.kae -platform Android -u -inputMapping /Volumes/PSSD/mxz/inke-client/code.inke.cn/tpc/multimedia/client/universal_sdk/InkeTigerMedia/TigerMediaCoreRepos/TigerMediaCore/Modules/RTCZegoLiveRoom/RTCZegoLiveRoom.Android/RTCZegoLiveRoom/build/outputs/mapping/release/mapping.txt -inputSymbol /Volumes/PSSD/mxz/inke-client/code.inke.cn/tpc/multimedia/client/universal_sdk/InkeTigerMedia/TigerMediaCoreRepos/TigerMediaCore/Modules/RTCZegoLiveRoom/RTCZegoLiveRoom.Android/RTCZegoLiveRoom/libs/arm64-v8a      
#!/bin/bash
echo 'start'
####################
APPID="aaa"
APPKEY="aaa"
VERSION="1.0.0"
BUNDLEID="com.bytedance.inf.kae"
PLATFORM="Android"
INPUTMAPPING="/Volumes/PSSD/mxz/inke-client/code.inke.cn/tpc/multimedia/client/universal_sdk/InkeTigerMedia/TigerMediaCoreRepos/TigerMediaCore/Modules/RTCZegoLiveRoom/RTCZegoLiveRoom.Android/RTCZegoLiveRoom/build/outputs/mapping/release/mapping.txt"
INPUTSYMBOL="/Volumes/PSSD/mxz/inke-client/code.inke.cn/tpc/multimedia/client/universal_sdk/InkeTigerMedia/TigerMediaCoreRepos/TigerMediaCore/Modules/RTCZegoLiveRoom/RTCZegoLiveRoom.Android/RTCZegoLiveRoom/libs/arm64-v8a"
####################


java -jar buglyqq-upload-symbol.jar -appid $APPID -appkey $APPKEY -version $VERSION -bundleid $BUNDLEID -platform $PLATFORM -u -inputMapping $INPUTMAPPING -inputSymbol $INPUTSYMBOL


echo 'done'