This version switches the Android project from the ancient structure to a modern one where the app code actually lives in app - so Android Studio and Android tooling is a lot more happy with it.
It is not installed by default yet, so you have to switch manually:
The path changes can mean that some plugins donât work any more, so it would be really nice if you could test it with your project and report any problems here or (if they are clearly problems with cordova-android) at issues.cordova.io
Nah, there was a cordova upgrade command that could be used to upgrade the platform without removing it first. This didnât work for iOS for quite some time, and now also doesnât for Android.
@Sujan12 agree with you. I hope I will find time in the next couple of days to try to update, letâs see if the other plugins I used are or will be compatible too (look like only the path is the big deal)
cordova.plugins.diagnostic causes issues for me when upgrading, looks like the hardcoded path of AndroidManifest.xml is wrong :
Failed to install 'cordova.plugins.diagnostic': Error: ENOENT: no such file or directory, open 'C:\Projects\SecretName\platforms\android\AndroidManifest.xml'
Any idea how to fix this? Iâm getting it with latest diagnostic plugin too.
cordova-plugin-firebase is throwing an error on âPreparing Firebase on Androidâ:
no such file or directory âŚ\platforms\android\res\values\strings.xml
That appears to have moved to app\src\main\res\values now
I edited cordova-plugin-firebase/scripts/after_prepare.js @ stringsXml: ANDROID_DIR + â/app/src/main/res/values/strings.xmlâ before adding cordova, and have verified that strings.xml was updated with the correct settings after adding Cordova 7.0
Create an issue at the pluginâs Github repo, include the information that this is about cordova-android 7.0.0 and a link to the announcement blog post - it includes the necessary information.
Please also create an issue with the plugin at Github. Include the information that this is about cordova-android 7.0.0 and a link to the announcement blog post - it includes the necessary information. Of course also include your manual workaround.
(Problem with just your workaround is that it then doesnât work with pre Cordova-Android 7.0.0 any moreâŚ)
A propos, does someone know the reason behind this breaking change (ânew default project structure for Android projectsâ) in cordova-android@7.0.0 which potentially impact of lot of plugins?
cordova-android still produced an Android project of the structure that was modern when Android used Eclipse. They moved stuff around a long time ago, and it got harder and harder to make Android Studio (and other Android tooling) to play well with that structure. This update moves some stuff around, which also enabled dropping quite some code for supporting that old structure.
(And I agree breaking the plugins is a bad thing⌠could maybe have been handled differently. But there are only a limited number of volunteer commiters to Cordova, soâŚ)
@Sujan12 thx a lot for the explanation, it makes then perfectly sense!
I guess we all gonna try to follow this upgrade one plugin after the other and at some point in the future, as always, everything gonna be good and sunny again, till the next breaking change