Closed InesBorgesCore closed 2 years ago
cordova-android has the patch which landed in version 10.1.2 for the android:exported
.
Cordova-android will manage the main activity, but if third-party plugins or libraries provides their own activities that may need to be updated as well. In those cases, the plugin maintainers needs to update their plugins to use the android:exported
on the activities they include.
The particular duplicate error is because you have two <activity>
tags with the same android:name
attribute. This could be caused by a conflict between your <edit-config>
rules and (presumably) the plugin that adds these activity entries. If the plugin maintainers are unable or otherwise unwilling to update their plugins, it may be best to fork the plugin if their license allows it. Alternatively you can try writing a hook instead of using <edit-config>
that manipulates the AndroidManifest
.
There are several known issues on <edit-config>
that makes it very difficult to use, unfortunately.
I need help figuring out how toprepare Cordova app for android API 31.
I tried to deploy an .aab file in Google PLay Console for a new app but it that it needs to support API 31 so I changed the preference attribute in
config.xml
.<preference name="android-targetSdkVersion" value="31" />
After that it gave me this error:
Apps targeting Android 12 and higher are required to specify an explicit value for
android:exportedwhen the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
So I googled it and stack overflow gave some tips and my code is the following:
Now it gives me this error:
Element activity#com.google.zxing.client.android.encode.EncodeActivity at AndroidManifest.xml:31:9-36:20 duplicated with element declared at AndroidManifest.xml:19:9-24:20 app\src\main\AndroidManifest.xml:37:9-42:20 Error: Element activity#com.google.zxing.client.android.HelpActivity at AndroidManifest.xml:37:9-42:20 duplicated with element declared at AndroidManifest.xml:25:9-30:20 \app\src\main\AndroidManifest.xml Error: Validation failed, exiting
In my
AndroidManifest.xml
file:How do I solve this? I solved this problem once but I don't know how. I didn't do anything special. It just started working after I commented the
edit-config
I added for the activities. Now it doesn't work like that.