Coder Social home page Coder Social logo

Comments (10)

wifisher avatar wifisher commented on May 30, 2024 1

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.

wifisher avatar wifisher commented on May 30, 2024 1

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.

wifisher avatar wifisher commented on May 30, 2024

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.

janpio avatar janpio commented on May 30, 2024

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.

goffioul avatar goffioul commented on May 30, 2024

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.

janpio avatar janpio commented on May 30, 2024

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.

janpio avatar janpio commented on May 30, 2024

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.

janpio avatar janpio commented on May 30, 2024

Ok, #357 now has a fix and is completely unrelated to this problem here.

So I now think this issue is actually about this:
image

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.

wifisher avatar wifisher commented on May 30, 2024

@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.

janpio avatar janpio commented on May 30, 2024

Not active in this project any more right now, sorry.

from cordova-windows.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.