Bugly 遇到的问题总结

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_34262972/article/details/87708455

关于Bugly 热更新的配置遇到的一些问题

1,打包时混淆代码注意

// 构建类型
    buildTypes {
        release {
            minifyEnabled true
            signingConfig signingConfigs.release
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            debuggable true
            minifyEnabled false
            signingConfig signingConfigs.debug
        }

混淆代码不是必要步骤,这里minifyEnabled 是混淆代码的作用,没有混淆代码的minifyEnabled 要设置true

2.bugly版本最好采用

compile 'com.tencent.tinker:tinker-android-lib:1.9.9'

3.bugly使用有两种application方式

一种使用自己的application,一种采用官方的解耦加载,不同的方式比照官网就可以了。

4.thinker_id这个要注意,这个打的base包要注意保持一致,打patch的时候修改baseApkDir对应base目录和thinker_id

5.

如果这个问题,可能是tinkerEnable = true这个没有加上

6.mainfest配置,需要修改

<!-- Bugly升级SDK配置开始  -->
        <activity
            android:name="com.tencent.bugly.beta.ui.BetaActivity"
            android:configChanges="keyboardHidden|orientation|screenSize|locale"
            android:theme="@android:style/Theme.Translucent" />
        <!--API 24以上配置-->
        <provider
            android:name="com.android.incongress.cd.conference.receiver.UpdateFileProvider"
            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>

7.上传的data包有时会发生检测不到当前base包,这里可能是没有成功完成base包,可以验证一下

先打好base包,安装打开后搜索tinkerid,看是否已经上报。

8.TinkerLoader: tryLoadPatchFiles:patch dir not exist:/data/user/0/com.mobile.

遇见这个,需要你打包完base_apk,安装启动载看log是否有tinkerId

集成过程中有好多问题,没有一一列举,先记录一下,如有问题可以提出,一起探讨

猜你喜欢

转载自blog.csdn.net/qq_34262972/article/details/87708455