集成腾讯Bugly使用自动升级
配置build.gradle
android {
defaultConfig {
ndk {
//设置支持的SO库架构
// abiFilters 'armeabi', 'x86', 'armeabi-v7a', 'x86_64', 'arm64-v8a'
abiFilters 'armeabi-v7a'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
// androidx ...
// Android 7.0及以上 FileProvider
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
// tencent bugly
implementation 'com.tencent.bugly:crashreport_upgrade:latest.release'
implementation 'com.tencent.bugly:nativecrashreport:latest.release'
}
配置AndroidManifest.xml
<application
android:networkSecurityConfig="@xml/network_security_config" <!--适配Android 9.0及以上-->
tools:ignore="UnusedAttribute">
<!--适配Android 7.0及以上-->
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileProvider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" />
</provider>
</application>
资源目录xml下新增 network_security_config.xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">android.bugly.qq.com</domain>
</domain-config>
</network-security-config>
初始化
Bugly.init(getApplicationContext(), "********", false);
网友评论