-
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
How to use tools:overrideLibrary inside config.xml to override splashscreen library? #1517
Comments
To insert the element tag uses-sdk you could do it like inserting permissions
|
@lempere thanks for the answer. However it doesn't work (and I think I tried it before). The following error occurs (btw. I'm using Cordova 11): Execution failed for task ':app:mergeDebugResources'.
Basically the two tags I'm trying are these:
|
You need to add Because the whole file is XML, it needs that namespace declared at the top level for parsing to succeed. |
I tried that as well but it just doesn't recognize it that way via widget. It has to be added manually with edit-config as I wrote in the post above. But even then the tools:ooverrideLibrary doesn't see it. |
I think I found a way to do ti somehow... But it still doesn't always circumvent the navbar dissapearing issue. In Android studio buiild navbar is there but via Cordova and VSCode it's not... Anyway I added these 2 things:
|
The last comment is confusing, what the What are you trying to achieve with that change? |
I'm trying to prevent nabar on the top from dissapearing on the app launch. That somehow started happening with introduction of Cordova 11 and splaschreen 6.0.2. Somewhere I saw that overriding SS plugin this way might help about it but it seems it's not a consistent solution. Also clearing cache helps it seems but it's not a valid solution. It happens on Android 13 and Pixel 6, while on some other phones it works ok. Also I do not understand about the minSdk version. Am I supposed to add that along overideLibrary? Which minSdk version should I put? I'm not an Android programer so for me all of this is quite confusing and help is apperiated. |
The minSDK was just an example of what that override does, it overrides whatever requirements/restrictions related to the SDK versions a library might have (max, min, target SDKs) that could conflict with your own app requirements. But the library has none, so adding that override is not doing anything. Your problem is really a problem with the new splash screen API, that doesn’t allow programmatic changes of the app theme (status bar, navigation bar, etc.) while the splash screen is being displayed (it’s an Android OS bug starting on android 12, but more noticeable on android 13 since on android 12 would only happen when launching from the app icon) Other solutions depending on the problem is to configure the app theme in the styles.xml file with styles you want your app theme to have, can be used for the status bar background and text color, and for the bottom navigation bar (gesture bar or the bar with software navigation buttons). |
Hmmm I see. Thananks for the answer! I guess there's nothing else but wait for a solution to this particular issue, or if nothing appears then to style/css our app so it somehow responds correctly to the navbar dissapearing. Bottom pic is with "navbar" disapearing and bottom one is how it should be without this bug: |
Is that a native bar or html bar? The problem is not going to be fixed for Android 12, and probably for Android 13 neither, I don't think it has even been reported to Google and even if reported, google is closing most of the splash related issues as "working as expected". If it's a native bar and you are using some plugin to show it, you can try to put the code to show the bar in a setTimeout with ~500ms, that worked for me on a similar issue where the app content was being put behind the status bar. |
It is cordova-plugin-statusbar plugin. So when I put a 500ms delay on the Statusbar.show() it shows but it's still plugged to the top of the screen (it should have the green top as you can see in the picture above): I realized that the statusbar plugin here is actually used only as a green bar on top and doesn't contain HTML elements iteself. |
So the bar with the bluetooth icon, the "my sites", "Map view" and other icons is html, right? try also calling |
Yes the bar contains html. I tried calling StatusBar.overlaysWebView(false); inside handleStatusBar function but it doesn't help. Code snippet that works with statusbar looks basically like this:
But adding timeout inside it, or calling handleStatusBar from a timeout doens't do too much good as well, as sometimes it works, and sometimes it overlaps the html elements in html bar as it seems that all these calls are random in timing in terms of what overlaps what so there is not a predictable outcome of how the top of the app looks like. |
Going to close since the problem has nothing to do with the original question. |
I am trying to override splashcreen library inside Manifest file by inserting following line into config.xml:
I have also inserted this into my config xml in the beginning:
And it works as it inserts the tools namespace inside the manifest tag.
However the tools:overrideLibrary part is a mystery to me. I'm not sure how to insert it into the manifest via config.xml.
I tried putting it inside another edit-config tag, and also config-file tag but I'm not sure about proper syntax (or if it can be done at all) for it to graft the correct Manifest in the end.
The text was updated successfully, but these errors were encountered: