话不多说直接开干…
1、安装Bugly插件:Bugly
安装完成之后重启
2、在工程的build.gradle中设置:classpath ‘com.tencent.bugly:symtabfileuploader:1.3.9’
3、在app的bugild.gradle中设置:apply plugin: ‘bugly’ 以及app的key和id
在dependencies {}中添加
compile 'com.tencent.bugly:crashreport:latest.release' //其中latest.release指代最新Bugly SDK版本号,也可以指定明确的版本号,例如2.1.9
compile 'com.tencent.bugly:nativecrashreport:latest.release' //其中latest.release指代最新Bugly NDK版本号,也可以指定明确的版本号,例如3.0
4、配置完成,初始化,在自定义Application中的onCreate()方法中初始化
/* Bugly SDK初始化
* 参数1:上下文对象
* 参数2:APPID,平台注册时得到,注意替换成你的appId
* 参数3:是否开启调试模式,调试模式下会输出'CrashReport'tag的日志
*/
CrashReport.initCrashReport(getApplicationContext(), "xxxxxxx", true);
5、后台已经看到版本号了,弄崩溃试试
6、测试代码:
测试效果:
//记录步骤在此,如有疑问看官方文档
//地址:
https://bugly.qq.com/docs/user-guide/instruction-manual-android/?v=20161130212726#_1