Comments (10)
Sorry, my mistake. The exception is occurring later when this.splashScreen
is dereferenced.
This fix would be more like:
function Manifest(text) {
XmlFile.apply(this, arguments);
this.splashScreen = this.loadTags(splashScreenTagName)[0];
if(!this.splashScreen && isWin10UWP) {
this.splashScreen = this.loadTags("uap:" + splashScreenTagName)[0];
}
}
from cordova-windows.
It's been a while since I looked at this and am currently away from my office. I think that all you need is to add the splashscreen plugin and then include a splashscreen preference (like the background color) in config.xml.
You see an exception in the console output of VS and the preferences don't get applied.
If you look at the Windows manifest file, you can see that the tags do not have the uap prefix.
from cordova-windows.
Same issue here. Breaks reading of the splashscreen preferences from the config.xml file.
A simple try/catch block in confighelper.js would get it working again:
function Manifest(text) {
XmlFile.apply(this, arguments);
try {
this.splashScreen = this.loadTags(splashScreenTagName)[0];
}
catch(e) {
if(isWin10UWP) {
this.splashScreen = this.loadTags("uap:" + splashScreenTagName)[0];
} else {
throw e;
}
}
}
from cordova-windows.
Hey @wifisher and @tibersept, thanks for your reports here. Let me check if I got everything correct:
Depending on what Windows 10 SDK is used to build (e.g. 10.0.17736
vs 10.0.17134
) the splashScreenTagName
that can be used to read the splashscreen from the manifest changes from SplashScreen
to uap:SplashScreen
. Correct?
Or does it depend on what Windows version is used to run the app?
What steps would one take on a new Cordova app created with cordova create
, cordova platform add windows
to be able to reproduce this? I'd love to help here, but am a bit lost. This Cordova Windows stuff is confusing sometimes.
from cordova-windows.
The uap:
prefix is part of the manifest template:
https://github.com/apache/cordova-windows/blob/master/template/package.windows10.appxmanifest
Given that the above file was modified more than 3 years ago, the real question is did that work before? And if yes, what else has changed that make it not work anymore?
from cordova-windows.
Hey @tibersept and @wifisher - I am still interested in recreating this problem and then trying to fix it: What steps would one take on a new Cordova app created with cordova create, cordova platform add windows to be able to reproduce this?
With a local reproduction I can look at what is actually going on, then further debug (or confirm your observations what code could fix it how) and possibly fix it.
But I need your help.
from cordova-windows.
Ok, so I tried to recreate this:
cordova create cordovaWindowsSplashscreen
cd cordovaWindowsSplashscreen
cordova platform add https://github.com/apache/cordova-windows
cordova plugin add [email protected] # explicit version to get around this bug: https://github.com/apache/cordova-lib/issues/790
cordova run windows
This lead me to see that a splashscreen images during fadeout is always missing, which I created an issue for: #357 This also includes the following output, which might be related to what we are investigating here:
'WWAHost.exe' (Script): Loaded 'Script Code (MSAppHost/3.0)'.
Exception was thrown at line 944, column 5 in ms-appx-web://io.cordova.hellocordova/www/cordova.js
0x800a138f - JavaScript runtime error: Unable to get property 'attributes' of undefined or null reference
Is this what we are talking about here?
I then tried to add a red background color as suggested by @wifisher:
<platform name="windows">
<preference name="SplashScreenBackgroundColor" value="red" />
</platform>
This worked just fine and switched the background color to red. What am I doing wrong @wifisher?
So back to this issue here, looking at the suggested fixes for a problem that I can't reproduce for now: #322 (comment) #322 (comment) #322 (comment) All of them basically make the script read from uap:SplashScreen
instead of just SplashScreen
.
But when I look at that code, the only code that is actually reading from the resulting object is Manifest.prototype.getSplashScreenImagePath
- or am I missing something?
Went on to test other preferences for the splash:
<preference name="SplashScreenDelay" value="10000" />
<preference name="FadeSplashScreenDuration" value="5000" />
And indeed, only when it reads from uap:SplashScreen
these work. But the code used to read from them doesn't really use uap:SplashScreen
in any way - this is just a side effect of the code crashing earlier!?
Am I looking at the right stuff here?
What is also confusing me:
Version 10.0.17736 requires the uap namespace, version 10.0.17134 is only ok without the namespace, same app build.
What does this mean @tibersept? I can't put this in context to what I am looking at here. The manifest has been uap:SplashScreen
for ages as mentioned in #322 (comment), so I don't understand how "version 10.0.17134 is only ok without the namespace" could be.
from cordova-windows.
Ok, #357 now has a fix and is completely unrelated to this problem here.
So I now think this issue is actually about this:
Changing the tag it tries to read from SplashScreen
to uap:SplashScreen
does indeed fix the issue properly it seems. I don't see any possible problems by this change and created #358
@wifisher Any objection on fixing this here instead of making the reads less brittle?
@tibersept Please see the last question in my previous comment - that is the only aspect I don't understand here yet.
from cordova-windows.
@janpio were you waiting on me for anything? I would like to see this fix rolled out so that I can disable the hook I have been using to effectively do what #358 does.
from cordova-windows.
Not active in this project any more right now, sorry.
from cordova-windows.
Related Issues (20)
- JavaScript UWP development from VS 2019 not supported HOT 1
- JavaScript UWP development from Visual Studio 2019 not supported HOT 1
- Can't cordova build or run platform windows with Visual Studio 2017 HOT 3
- use @cordova/eslint-config HOT 1
- META: start major release 8.0.0 with some breaking changes HOT 1
- Can we use target minimum windows SDK version 10.0.16299.0 HOT 1
- Error: WebGL not supported HOT 2
- Windows: uap capability included when building for 8.1 HOT 1
- Using Chrome-based webview as rendering backend for Cordova for Windows instead of EdgeHTML HOT 2
- comma as decimal separator on ```<input type="number"> ``` HOT 1
- window.alert , prompt, confirm not working, please help me it is an emergency. Please please help me urgently.ππ»ππ»ππ»ππ» HOT 1
- The following navigation rule had an invalid URI scheme and will be ignored: "*". HOT 1
- Microsoft Surface hybrid touch events HOT 1
- Absolute (root relative) paths do not resolve to www folder, instead point to C:\... HOT 3
- Cordova installation problem HOT 2
- Running HelloWorld throws an error HOT 2
- package.windows10.appxmanifest does not set the correct descriptions as in config.xml HOT 1
- instructions from https://cordova.apache.org for platform Windows erroneous HOT 1
- The processor architecture of your project 'arm' doesnβt match the processor architecture 'x86' of the referenced project 'SQLite3.UWP'. HOT 1
- shelljs 0.5.3 is vulnerable HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-windows.