Closed javico-dev11 closed 1 year ago
@javico-dev11 Have you found a solution? i'm trying to create Android12 support for our app. I too face the same issue when I add android:exported
When we execute "Cordova platform add android"
it adds the config, then if we execute Cordova prepare android
it creates duplicate.
I just added the below line in Config.xml
and it worked for me.
<preference name="cordova-custom-config-autorestore" value="true" />
@sarathi0333 what did your line look like in the config.xml for adding that android:exported
value? I am trying to do the same thing, however, its adding the line to the
Currently using this but its wrong
<custom-preference name="android-manifest/application/service[@android:name='org.apache.cordova.firebase.FirebasePluginMessagingService']" value="@android:exported/false" />
I ended up doing this. I think that is what I wanted. I was confused by the docs
<custom-config-file target="AndroidManifest.xml" parent="./application">
<service android:name="org.apache.cordova.firebase.FirebasePluginMessagingService" android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
</custom-config-file>
apparently when I run build through the ionic dashboard, this does not work.
Hey Guys,
So this worked for me. I found that the following runs after the firebase plugin edits the manifest. Which means we can delete and add a new service or merge which ever works for you.
<custom-preference delete="true" name="android-manifest/application/service[@android:name='org.apache.cordova.firebase.FirebasePluginMessagingService']" />
<custom-config-file mode="merge" parent="./" target="AndroidManifest.xml">
<service android:enabled="true" android:exported="false" android:name="org.apache.cordova.firebase.FirebasePluginMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
</custom-config-file>
I am adding android:exported in AndroidManifest.xml but the edited service or activity is duplicated
`
`
For example if I add android:exported it duplicates that code without the added attribute