TencentCloud / TIMSDK

Tencent Cloud Chat features a comprehensive suite of solutions including global access, one-to-one chat, group chat, message push, profile and relationship chain hosting, and account authentication.
https://trtc.io/products/chat
2.54k stars 2.77k forks source link

Android targetSdkVersion 31之上,所有<receiver>都添加了android:exported=“true” 还是报错 #1320

Closed petersom closed 1 year ago

petersom commented 1 year ago

【Android】-【6.9.3557 】:【Android targetSdkVersion 31之上,所有都添加了android:exported=“true” 还是报错】 【集成包】:TUIKIT/TUIOfflinePush 【当前现象】:所有都添加了android:exported=“true” 还是报错 【机型】:如华为Mate 20 【之前版本有无此问题】:有 【有无日志或者截图】: android:exported needs to be explicitly specified for . Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.

chengqw commented 1 year ago

// xiaomi implementation "com.tencent.tpns:xiaomi:1.3.7.2-release" // huawei implementation 'com.tencent.tpns:huawei:1.3.7.2-release' implementation 'com.huawei.hms:push:6.7.0.300'

请按照如上方法升级下推送包再试试

Bruce-zxy commented 1 year ago

// xiaomi implementation "com.tencent.tpns:xiaomi:1.3.7.2-release" // huawei implementation 'com.tencent.tpns:huawei:1.3.7.2-release' implementation 'com.huawei.hms:push:6.7.0.300'

请按照如上方法升级下推送包再试试

升级以后要注意hms:push的permission覆盖的问题,否则会报错:

Manifest merger failed : Attribute permission#com.daoing.client.permission.PROCESS_PUSH_MSG@protectionLevel value=(signatureOrSystem) from [:react-native-tim-push] AndroidManifest.xml:18:9-52
        is also present at [com.huawei.hms:push:6.7.0.300] AndroidManifest.xml:11:9-44 value=(signature).
        Suggestion: add 'tools:replace="android:protectionLevel"' to <permission> element at AndroidManifest.xml:16:5-18:55 to override.

添加了tools:replace="android:protectionLevel"以后就可以正常build了

image