HMS-Core / hms-cordova-plugin

This repo contains all of Cordova HMS plugins.
https://developer.huawei.com/consumer/en/doc/overview/HMS-Core-Plugin?ha_source=hms1
Apache License 2.0
89 stars 42 forks source link

Fix of build for Android 12 #105

Closed vovka-s closed 1 year ago

vovka-s commented 1 year ago

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @hmscore/cordova-plugin-hms-push@6.3.0-304 for the project I'm working on.

Build fails due to HmsLocalNotificationBootEventReceiver has no android:exported attribute I added it but I'm not sure that the value true is correct Please check it

Here is the diff that solved my problem:

diff --git a/node_modules/@hmscore/cordova-plugin-hms-push/plugin.xml b/node_modules/@hmscore/cordova-plugin-hms-push/plugin.xml
index 0c76979..265ed8d 100644
--- a/node_modules/@hmscore/cordova-plugin-hms-push/plugin.xml
+++ b/node_modules/@hmscore/cordova-plugin-hms-push/plugin.xml
@@ -55,7 +55,8 @@
            <receiver
                android:name="com.huawei.hms.cordova.push.receiver.HmsLocalNotificationActionsReceiver" />
            <receiver
-               android:name="com.huawei.hms.cordova.push.receiver.HmsLocalNotificationBootEventReceiver">
+               android:name="com.huawei.hms.cordova.push.receiver.HmsLocalNotificationBootEventReceiver"
+               android:exported="true">
                <intent-filter>
                    <action android:name="android.intent.action.BOOT_COMPLETED" />
                </intent-filter>

This issue body was partially generated by patch-package.

Xuejiao-Shi commented 1 year ago

The Cordova Push plugin does not adapt to Android 12 yet. You are advised to manually add the export configuration as follows:

android:exported="false"

vovka-s commented 1 year ago

The Cordova Push plugin does not adapt to Android 12 yet. You are advised to manually add the export configuration as follows:

android:exported="false"

Ok, thanks!