-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cordova 11.0.0 + Android 11.0.0 - cordova prepare android --debug command fails #1461
Comments
How to use the latest
Thanks in advance. |
If you want install a development build, you have to use the github repo url. e.g. Which will install the main branch. NPM also supports Alternatively, you can
Based on the output:
The issue appears to be related to using target SDK 33, which is an SDK level that Cordova might not support yet. cordova-android@11 adds support for SDK levels that was available during the time of development, which was up to SDK 32. Try removing |
I changed Android SDK from 33 to 32. The major problem is in the function Then I don't know about the other problems... |
Is there a possible work-around to set some variable or parameter in config.xml (e.g. |
Sorry, I missed this on my first time reading your ticket. Not providing any splashscreen at all is simply not possible. Android now enforces the splashscreen on Android 12 or later. On older versions of Cordova, you would see the Android splashscreen, as well as the cordova custom splashscreen (which could have been disabled) if you run your app on Android 12 devices. This is behaviour that cannot be changed. Android Docs highlights some unintended consequences if you do not migrate to the new splashscreen system, which cordova-android@11 implements. In cordova-android@11, to make the Android 12 splashscreen backwards compatible, it includes a compatibility library that implements the Android 12 splashscreens on older devices. This library is provided by Google. cordova-android@11 does not support |
Well, I know this, but we just have not specified any splash screens at all in config.xml. Then the default Cordova ones are always used, unless we set it to display "none". The app logo is shown on startup on black color using Cordova Android 10.1.2 under Android 12+ (and this is fine). But for Cordova Android 11.0.0, the project cannot be "cordova prepare"'ed. THAT IS THE PROBLEM. Then for the documentation you refer to: it is pure Android and is not specific for Cordova. Is there any doc available for how to define all this for Android in config.xml for Cordova Android 11.0.0? |
You should not install Also the preference only controlled the As @breautek pointed out
It also includes Googles design requirements, and for Cordova-Android to continue to support older devices with consistency, the compatibility library was added. This means the SplashScreen will be displayed for API 22+, no option to turn off. As for the error, maybe try deleting the entire |
I am experiencing this same error as well. I've uninstalled the Side note: Could we get a migration guide of some kind? This took some serious reading of release notes to figure out. |
I have done some further investigation as to why our project fails performing the
A new file is generated by the
When looking at our
When removing the line An interesting thing is however happening when the Android platform is added with our config.xml file, perhaps because we use the plugin
and the fact that we have some specifications for the splash screen that is now deprecated:
leaves us with the mystery below. Once our Android platform is generated from an existing
For some reason, the XML schema specification We have NO CLUE as to from where the So PLEASE: can Cordova provide better documentation for the Android platform as to regarding the specifics to define the Then how does one add just a new color definition, in our case the background color for our adaptive icons as the current Cordova documentation example suggests to do, i.e. to specify the icons as we did with a background color:
In our case, this issue was resolved by either omitting the line
After this, the issue was resolved, but we still do not understand how to define these two colors (and perhaps other things), specific to Cordova Android 11+, such as the colors |
Is there a rough "release date" for this new plugin? Request for DocumentationPlease add documentation for the Cordova-specifics for |
We do not add You are most likely installing some plugin that is updating the colors.xml file. Also, see Cordova's Core Feature SplashScreen Documentation on how to configure the SplashScreen. Everything that is needed to know is defined there. https://cordova.apache.org/docs/en/11.x/core/features/splashscreen/index.html It does not explicitly say what sets Most Cordova developers just want to know how to change the Background Color, which there is a preference called If we documented every internal variable then the documentation would most likely become unreadable or information overload. You might want to start by reading the documentation. And no, not all of those preferences were deprecated and removed. We tried to keep those that were still valid and able to be used. Again its in the documentation linked above. |
Well, @erisu, I have read that documentation quite well. And it's almost impossible to understand what we have done wrong with the I think the issue is the failure of Probably the setting |
??? |
[email protected] is and has been released. It's been updated so it doesn't install on cordova-android@11 so it doesn't cause conflicts, particularly if you still require it because you develop for other platforms.
I think Erisu clearly stated what is new and valid for cordova-android@11 moving forward is documented. And like he mentioned, some preferences when applicable, was carried over from the older splashscreen plugin, which are also documented.
This is a nature of any plugin system. Yes it's an issue but not necessarily within Cordova codebase. From what I understand reading this thread, there are two occurrences where this happens.
If you're manually managing/overriding the colors.xml` file which the core platform now depends on. Then you'll need t re-implement everything that Cordova does to manage this file to support all the features that Cordova has around this file. This isn't a bug with Cordova.
It is possible that plugins have defined their own colors.xml because they have their own native UIs. If they are overwriting Cordova's colors.xml, that will make plugins incompatible with cordova-android@11. They'll have to be updated to use <config-file to append to the file, or if they require to edit an existing node. As with all major releases, there is potential for breaking changes. In this specific case there is incompatibility with cordova-android@11 and firebasex due to a configuration conflict. But this doesn't make it a bug.
Edit: I just tested |
I use Ionic/Angular framework and "cordova prepare android" is giving the same errors (cordova-android 11.0.0 ) that minduch has. I have tried next workarounds for cordova-plugin-spashscreen: different versions, remove and set none. I need stay in android SDK 31/cordova-android 10.1.2 until fix idea or update. |
Hi, |
FWIW - I ran into this problem because the Cordova Android documentation at the link below explicitly says to create a res/values/colors.xml file for adaptive icons with colors and doing that triggers this error when upgrading to Cordova 11. The documentation at the link below should probably be updated to recommend a different file name if no other fix is being worked on for this issue. https://cordova.apache.org/docs/en/11.x/config_ref/images.html#adaptive-icon-with-colors |
@scyclops Thank you for pointing out the docs you followed that caused this issue. Before Cordova-Android 11 the This line will now cause issues as it will overwrite the exisiting E.g. <resource-file src="res/values/myCustomAdaptiveIconColors.xml" target="/app/src/main/res/values/myCustomAdaptiveIconColors.xml" /> You can keep whatever you have now in the You might also be able to use I will take a look in updating the documentation. |
Changing target directory doesn't help. It doesn't limit to this specific |
Hello, I removed the plugin cordova-splashcreen and I still have this issue. This is how looks my colors.xml :
What is the solution for this issue ?
|
Hi, i was getting this bug upgrading from cordova 10 to 12.
|
Renaming
|
Worked here. Documentation should be updated. Thanks! Though, on build, it does say:
|
Ran into this problem too. Renaming |
Bug Report
Using Cordova 11 and Android 11.0.0, the
cordova prepare android --debug
command fails with:Problem
We do not want to display a splash screen at all, and the only way to do so is to include the
cordova-plugin-spashscreen
and then turn it off using<preference name="SplashScreen" value="none"/>
. Please note that we don't provide any splash screen assets.What is expected to happen?
The production of the prepared Android Cordova build.
When using Cordova Android 10.1.2 it worked fine.
What does actually happen?
Cordova Prepare fails with the verbose output:
Information
The config.xml file:
The part with all the icons could probably be left out for testing.
As you can see, there are no provided spash screens.
Source code of
C:\iizi\iiziRunDevel\node_modules\cordova-android\lib\prepare.js:484:68
:If I edit the source code to include the following line before line 484:
The prepare command works a little bit longer but fails as show below, and I don't know the side-effects.
Command or Code
cordova prepare android --debug
Environment, Platform, Device
Windows 11, Node v16.16.0, Cordova 11.0.0, Android 11.0.0.
Version information
Checklist
The text was updated successfully, but these errors were encountered: