[SOLVED] Compiling for Windows


Samuel Vanneste

Hello,
Please do you have some errors while compiling for Windows ?
I have created a sample app, installed Visual Studio and compiled.

The first attempt produced that log :

Summarized:
[list=*]

  • The following navigation rule had an invalid URI scheme and is ignored

  • Wrong dimensions or weight too heavy for two images

  • So, I corrected what I could :
    [list=*]

  • reduced the weight of 'images\Square310x310Logo.scale-100.png'

  • reduced the size of 'images\StoreLogo.scale-100.png' to 50x50 pixels

  • I retried to compile again using the 'cordova_windows_run' batch file and got that log


    Errors about the same images weight and sizes.

    Please do you know how I could fix that ? Many thanks


    decsoft

    Hello Samuel,

    Maybe I need to change my avatar too... :) Well. To be honest I did not try too much with the Windows platform, but it's something I must do. Certainly I found the problem you mentioned, but right now I can't figure a way to solve it.

    The problem is mainly with the "image sizes", since all other can be apparently ignored (at this time). But the "image sizes" problem is not related with the images dimensions, but with the images files sizes...

    So what you can try (for now) is not to change an image from 100x100 to 50x50. We must provide the 100x100 image, but their file size can't be greater than the required size (?) which is about 200 Kb.

    Try that Samuel and then probably we can continue talking about...



    Samuel Vanneste

    Hello David,
    Thanks again for your reply : I finally got it by doing this :
    [list=*]

  • reduced the weight of the images located inside \res\icons\windows

  • I had to reduce the size of the image 'StoreLogo.scale-100.png' to 50x50 (as the logs printed) and [ins]put that image as readonly[/ins] or it is resized while compiling

  • About the avatar, well... hu... you absolutely don't need it, Master ;)


    decsoft

    Hello Samuel,

    I think the change to 50x50 is not required if we reduce the image weight first. So, if I am not wrong, the 100x100 image is good, except their weight must be reduced. I don't think the readonly attribute can matter here, but who knows! If finally the 50x50 is required App Builder can prepare such image.

    On the other hand, that's the problem. App Builder, from the provided image, prepare dozens of different image/sizes per the different platforms. There is no problem to made an image 100x100 or 200x200, but how I can set the weight of an image? And without change too much the image quality...

    That's the problem I found and I must solve. But honestly I don't know if this is a problem of the platform or what: any other platform complains about the images weight. Maybe about the images dimensions (and for that reason App Builder prepares various images sizes) but not the images weight.

    Definitely I must look into this...



    decsoft

    Hello Samuel,

    I am working on this issue and the current release of App Builder has this changes and enhancements:


    * Fix a problem with certain app's icon for the Cordova's Windows platform, which causes the Cordova's build can't end correctly. After this fix we can build our apps for the Cordova's Windows platform (for Microsoft Windows 10 for example) without that problems.

    * Add some new AngularJS img-src sanitization white list items like "ms-appx-web" in order to be ready with the Cordova's Windows platform. Before this addition app's images are not properly shown in the Cordova's Windows platform.

    * Added the new Splash compression level options in the Behaviour tab of the program's options dialog. This new option allow us to set the compression level for the PNG generated by App Builder from the app's splashs. By default the compression level is 5, which also solve the problem with some image weight for the Cordova's Windows platform.

    * Added the new Icons compression level options in the Behaviour tab of the program's options dialog. This new option allow us to set the compression level for the PNG generated by App Builder from the app's icon. By default the compression level is 5, which also solve the problem with some image weight for the Cordova's Windows platform.

    Update your App Builder copy Samuel and try it to build your app for the Windows platform. Below you can see the Calculator sample running in my Windows 10 operating system:

    Hope this can be useful for you! :)



    Samuel Vanneste

    Hello David,
    I do thank you for that new version but I still do have bad news about.

    After having updated to version #2016.135, I did compile the Calculator's app as you did. What I have noticed is this :
    [list=*]

  • the compilation failed because the image "Square310x310Logo.scale-100" had a weight over 204 Kb (we have already seen that previously)

  • some new Cordova's icons were created

  • if I set a splash screen, it is lost and replaced by Cordova's own splash screen

  • Below is the content of the \Calc_Compiled\platforms\windows\images after compilation and creation of the new icons.

    Please did you had such troubles on your part or, perhaps is it a faulty configuration on my PC ? Many thanks David


    decsoft

    Hello Samuel,

    Perhaps what happend is you don't change (I need to revisit this in the future, because if you upgrade App Builder the compression level is "0", which means "No compression", which means larger image files, which cause the problem...) the compression levels? Take a look at the below image and set the trackbars more or less that you can see:



    Samuel Vanneste

    Hello David,
    After several trials, nothing to do (on my PC). If you would like to try my project
    But please, only if you have some time (because it could be on my own PC, I am currently checking everything)


    decsoft

    Hello Samuel,

    I asume you try with my suggested changes in the Icons compression level. Ok. Please, Samuel, delete by hand the "_Compiled" directory of your application and then try to compile it again. If I can do it here... then you must do it!



    decsoft

    Hello Samuel,

    I cam compile your sample here:

    Certainly the splash screen do not appear (in their place a Cordova's generic icons is shown), at least for some screen sizes, but I will investigating that...



    decsoft

    Hello Samuel,

    I simply can't understand why the splash screen issue. I follow the Cordova documentation and provide with the two required (for Windows) splash screen files. Then Cordova creates (by their hat) some other images, which are finally used, at least in some screen sizes. I will take note about this and try to search for a posible solution.

    P.S. I know Cordova generates some images because I try to generate the same images from App Builder without success.



    decsoft

    Hello Samuel,

    Some news about this issue. Finally App Builder creates up to 21 different icons and 3 splash screens for the Windows platforms. As you can see when upgrade your App Builder copy, only three icons appear to be missing! That is, even when App Builder provide it, something is wrong,... since Apache Cordova put in their place their default icon.

    Of course I will to continue investigating this, however, certainly I am go so far from the Cordova's documentation. In fact some of the icons are not well documented or at least I can't found it documented.



    Samuel Vanneste

    Hello Boss ;)
    There is my return (I really hope not to bother you because I am not clear at all on that point and you know more than me) :
    [list=*]

  • I have updated to v2016.136

  • I have noticed that 3 icons still were the ones from Cordova instead the ones App Builder created

  • So I have tried to edit the App options \ Configuration \ Extra XML thinking it will copy the images instead of creating the Cordova's ones

  • After compilation, the images were created but with another name

  • Images concerned

    Code put into Extra XML

    Images were copied but with a new name like, for example : "SplashScreen.scale-100.scale-100.png"

    I will continue to try to find a solution this evening and will report if I can find one. Thanks for all the patient and helpful support you do provide David


    decsoft

    Hello Samuel,

    Thanks for your efforts. As you can see only three icons appear "as default". However App Builder try to prepare such icons, in the same way than prepare the others.



    Samuel Vanneste

    Hello David,
    Yes, App Builder does its job perfectly. If I can not find a valid solution, the one I (and the others) can use is copying the images prepared by App Builder and make them read only so Cordova won't replace them (but I will continue trying).
    Wishing you a good evening David :)


    Samuel Vanneste

    SOLVED thanks to App Builder.

    We simply have to add this to Extra XML (inside App Builder in : App options\Configuration\Extra XML)


    decsoft

    Hello Samuel,

    Many thanks for your efforts. Certainly I need to take a look in deep in the near future. :)



    Samuel Vanneste

    Hello David,
    A quick note to spare your precious time : the problem surely is on my part as I can not get a "release" Windows version getting an error MSB3779 (still searching on my part - mostly the 64 bits version of the SDK but still unsure).

    Just read that : "You can not build for Windows 10 with the architecture AnyCPU"
    [s]How may I make a release as Cordova modifies the configuration file. Modify it and make it read only ? Thanks[/s]

    Currently trying to modify the batch file to include the targeted CPU : worked. So we have to modify "cordova_windows_release.bat" to add the platform (but we can not from the BATCH app option) :

    Edit: installed the Release package. And got an error about some Javascript code inside after the splash screen. Well, it seems that the solution for me is using Phonegap now.


    decsoft

    Hello Samuel,

    Thanks very much for your efforts. I really appreciate it. I will take note also about the possible new BAT file option. I am very sorry, but I expend today into the hospital with my mom, and probably tomorrow too... I promise I put me into this and other things as quickly as possible Samuel.



    decsoft

    Hello Samuel,

    Please, update your App Builder copy. Among other enhancements the current AB release includes a new "Architecture type" option in App Options / Cordova / Windows. The architecture type is only taken in consideration when creates the "release" BAT file. If you think they can be useful too in the "run" and "debug" BAT files, please, just post it here and I will add for the next release.

    Thanks for your feedback!



    Samuel Vanneste

    Hello David,
    Thanks for that improvement : it works great and is very useful. +11111 :)


    decsoft

    Hello Samuel,

    You're welcome! App Builder rocks! And you are near to be an App Builder ninja! :)



    decsoft

    Hello to all,

    Finally I made certain changes in App Builder in order to fix some problems related with the icons and splash screens generator. I encourage you to update your App Builder copy Samuel.


    * As a try to solve the problem explained in the next point, App Builder try to copy some Cordova's Windows splash screen images into the icons directory, which have non sense at all. This is fixed now and such images are not copied anymore.

    * The splash screens files for the Cordova's Windows platform has been correctly generated by App Builder, however, they are not well referenced in the Cordova's configuration file, causing such files are not taken in consideration when build the application. This is fixed now. Thanks Bekhzod to point me in the right direction!

    * App Builder no more generates icons and splash screens for the Windows 8 platform, since this has been depretaced by Cordova (and also by App Builder time ago) and use in their place the icons and splash screens generated by the Windows platform.

    * The App Builder's icons generated for the Cordova Windows Phone 8 are not well referenced in the Cordova's configuration file. They refer to a "wp8" folder when the icons are generated and placed at a "wp" folder. This is fixed now.

    * A new icon size has added for the Cordova's Windows platform: StoreLogo.scale-240.png. This is apparently the only one icon missing when I try to build a sample application for the Cordova's Windows platform. This icon, however, continue to be untaken by Cordova or Windows, and I need some further investigation. Anyway this icon appear to not used by Windows, at least when our app is launched.

    Hope this can be useful!



    decsoft

    Hello Samuel,

    I know this is an old thread, however, maybe this new release of App Builder can be of your interest, since we introduce the support for the recently added Apache Cordova's Electron platform. By now, with this new Cordova's platform, we can create Windows' native executables and installers for our apps.


    Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

    This website uses some useful cookies to store your preferences.

    I agree. Hide this note. Give me more information.