We are in the process of migrating our project from capacitor 3 to capacitor 4 . We have used the CLI command to do the migration , after attempting the migration we are seeing below issues. -
For the Cordova-capacitor android project that gets automatically created , Every time I have to add ’android:exported="true” in AndroidManifest.xml.
We are using Cordova whitelist plugin ,After the migration I’m getting a build error in Whitelist plugin. I have solved it by changing the plugin code to use AllowList.
Is their any way I can ask capacitor to do changes while syncing and running the project.
capacitor-cordova-android-plugins module gets generated from your cordova plugins. So the plugin needing the
android:exported="true” should be updated to add it instead of you having to add it manually.
Whitelist plugin should not cause any build issues, your problem is probably another plugin that was updated to use cordova-android 11 where whitelist plugin is integrated and renamed to AllowList.
If that’s the case, you can try updating
cordovaAndroidVersion = '10.1.1' to
cordovaAndroidVersion = '11.0.0' and removing the whitelist plugin.
You can use CLI hooks to run scripts before/after some capacitor command execution, and you can use those scripts to do the changes programmatically instead of manually
Thanks For reply… this way its working fine