hms-push-clientdemo-android icon indicating copy to clipboard operation
hms-push-clientdemo-android copied to clipboard

Android 12 crash

Open HlebMaliborski opened this issue 4 years ago • 8 comments

Hi! In our app we have dependency: com.huawei.hms:base:6.1.0.302 and use HuaweiApiAvailability class.

As result of calling this function PendingIntent getErrPendingIntent(Context var1, ConnectionResult var2) we have exception:

Process: com.netcetera.tpmw.ndb.app.preview, PID: 10355 java.lang.IllegalArgumentException: com...preview: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles. at android.app.PendingIntent.checkFlags(PendingIntent.java:375) at android.app.PendingIntent.getActivityAsUser(PendingIntent.java:458) at android.app.PendingIntent.getActivity(PendingIntent.java:444) at android.app.PendingIntent.getActivity(PendingIntent.java:408) at com.huawei.hms.api.b.getErrPendingIntent(HuaweiApiAvailabilityImpl.java:10) at com.huawei.hms.common.internal.BaseHmsClient.resolution(BaseHmsClient.java:3) at com.huawei.hms.common.internal.BaseHmsClient.checkAvailabilityAndConnect(BaseHmsClient.java:34) at com.huawei.hms.common.internal.BaseHmsClient.connect(BaseHmsClient.java:1) at com.huawei.hms.common.internal.HuaweiApiManager$ConnectionManager.connect(HuaweiApiManager.java:21) at com.huawei.hms.common.internal.HuaweiApiManager$ConnectionManager.sendRequest(HuaweiApiManager.java:24) at com.huawei.hms.common.internal.HuaweiApiManager.connectAndSendRequest(HuaweiApiManager.java:8) at com.huawei.hms.common.internal.HuaweiApiManager.handleMessage(HuaweiApiManager.java:7) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288)

Question: are you planning to update PendingIntens with new flag for Android 12?

HlebMaliborski avatar Sep 17 '21 14:09 HlebMaliborski

Thank you for your feedback, the R&D team confirms that a fixed version will be released at the end of September. Please use the latest version for testing by that time. Thanks.

See : https://stackoverflow.com/a/69232813/13329100

Mike-mei avatar Sep 18 '21 09:09 Mike-mei

Hi @Mike-mei , thanks for response! Do you have exact date when new release will be deployed? Today is 30 of September but there is no new version.

Thanks.

HlebMaliborski avatar Sep 30 '21 15:09 HlebMaliborski

It's still under development, we will notice you when the new version released.

Mike-mei avatar Oct 08 '21 02:10 Mike-mei

Well, 2022 and issue is still present

emakar avatar Jan 05 '22 11:01 emakar

Well, 2022 and issue is still present

You can update the push SDK to 6.3.0.300 version, android 12 adaptation issues have been solved in this version, please try again. 05BF8E0A-5451-4839-AF61-4F132CC57F66 .

Mike-mei avatar Jan 06 '22 01:01 Mike-mei

Thanks, I'll let you know

emakar avatar Jan 13 '22 13:01 emakar

Well, 2022 and issue is still present

You can update the push SDK to 6.3.0.300 version, android 12 adaptation issues have been solved in this version, please try again. 05BF8E0A-5451-4839-AF61-4F132CC57F66 .

还是存在implementation 'com.huawei.hms:push:6.3.0.300'

Installation failed due to: 'Failed to commit install session 796099279 with command cmd package install-commit 796099279. Error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl796099279.tmp/base.apk (at Binary XML file line #392): cn.jpush.android.service.PluginOppoPushService: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present'

xiaocode337317439 avatar Mar 14 '22 11:03 xiaocode337317439

@xiaocode337317439 您好,从截图看像是您接入的三方平台那边的报错,建议您直接接入华为推送,我们试了6.3.0.300和6.3.0.302,都没有这个问题

Xuejiao-Shi avatar Mar 15 '22 01:03 Xuejiao-Shi

Fixed with PR #15

minkiapps avatar Sep 06 '22 14:09 minkiapps