天天看点

【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'