apache / cordova-windows

[DEPRECATED] Apache Cordova Windows
Apache License 2.0
203 stars 171 forks source link

Blank page #340

Closed robertnicjoo closed 5 years ago

robertnicjoo commented 5 years ago

I have Ionic app which so far i made android app and app is working just fine in fact it's released to google store as well, so everything is really fine with my app until I added Cordova Windows Platform in order to have another version of my app and now when I open my project on VS17 and run the app this is what I get:

ni

Blank window.

Info

OS: Windows 10
IDE: VS17
Installed Windows 10  SDK
Installed MSbuild
Installed UWP

Note: if I run command ionic cordova build windows I get:

ENV var MSBUILDDIR is set C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin
rm: could not remove directory (code ENOTEMPTY): C:\laragon\www\ionic\xxxx\platforms\windows\build/windows

rm: could not remove directory (code ENOTEMPTY): C:\laragon\www\ionic\xxxx\platforms\windows\build/windows
rm: could not remove directory (code ENOTEMPTY): C:\laragon\www\ionic\xxxx\platforms\windows\build

Building project: C:\laragon\www\ionic\xxxx\platforms\windows\CordovaApp.Windows10.jsproj
        Configuration : debug
        Platform      : anycpu
        Buildflags    : /p:AppxBundle=Never
        MSBuildTools  : C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin
buildProject spawn: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild [ 'C:\\laragon\\www\\ionic\\xxxx\\platforms\\windows\\CordovaApp.Windows10.jsproj',
  '/clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal',
  '/nologo',
  '/p:Configuration=debug',
  '/p:Platform=anycpu',
  '/p:AppxBundle=Never' ] { stdio: 'inherit' }
  prebuild.js: Patching platform `10`
  - Injected `base.js` reference to `/www/index.html`
  - Removing /( *)(<script\s+(?:type="text\/javascript"\s+)?src="\/\/Microsoft.WinJS.2.0\/js\/base.js">\s*<\/script>)(\s*)/ from /www/index.html
  - Removing /( *)(<script\s+(?:type="text\/javascript"\s+)?src="\/\/Microsoft.Phone.WinJS.2.1\/js\/base.js">\s*<\/script>)(\s*)/ from /www/index.html
C:\laragon\www\ionic\xxxx\platforms\windows\CordovaApp.Windows10.jsproj(86,9): error : The following component requires .NET Native compilation which is not available when targeting 'Windows10' and 'AnyCPU'. Consider changing the targeted processor architecture to one of the following: 'x86, x64, ARM' (if you are using command line this could be done by adding '--archs' parameter, for example: 'cordova build windows --archs=x64'). C:\laragon\www\ionic\xxxx\platforms\windows\plugins\onesignal-cordova-plugin\OneSignalSDK_WP_WNS_WRTC.winmdNo valid MSBuild was detected for the selected target: Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild: Command failed with exit code 1

And If I use VS17 I get blank screen.

Any idea what might be wrong?

janpio commented 5 years ago

Does it work for a new project created with cordova create? Did you remote debug your app to see if there are any Javascript errors in the console?

robertnicjoo commented 5 years ago

@janpio

1- cordova create as I'm working on ionic app i have no idea about this command! :)

2- When I opened my app with VS17 there was no error in there but i didn't try to open in in browser :)

BUT

I've made a total new app with VS17 (100% cordova app) and when I tried to run it i got this:

The targeted toolset could not be found on disk. Please go to Visual Studio Setup and run a repair to reinstall it.

So based on that I am updating my VS now not sure if it will work or no or even if that's the issue, so please feel free to share your thoughts in the meantime.

janpio commented 5 years ago

1- cordova create as I'm working on ionic app i have no idea about this command! :)

Then please use it now to make sure your local system can create a working Cordova Windows app: cordova create, cd ..., cordova platform add windows, cordova run windows.

I've made a total new app with VS17 (100% cordova app) and when I tried to run it i got this:

You can only create pure Cordova apps with the Cordova CLI (as described above). Everything else uses software that is not directly supported by Apache Cordova. Visual Studio does not offer Cordova support out of the box, so you have to have installed some workload or feature that might claim Cordova support, but should not really be needed. (Actually Visual Studio does never have to be opened at all to create a Cordova Windows app - it only has to be installed correctly. Everything else can happen on the command line)

robertnicjoo commented 5 years ago

Then please use it now to make sure your local system can create a working Cordova Windows app: cordova create, cd ..., cordova platform add windows, cordova run windows.

C:\Users\xxxxx\Desktop\New
λ cordova create
Directory not specified. See `cordova help`.

but with this

C:\Users\xxxxx\Desktop\New
λ cordova create fgh
Creating a new cordova project.

it creates it and i get this

122

I assume that means the blank issue isn't related to cordova but my ionic then! :)

Thanks for all helps <3

janpio commented 5 years ago

Yes, you just made sure that Cordova can actually build a successful working app on your system - so the problem is with your existing app somehow.

You can use https://www.microsoft.com/en-us/p/microsoft-edge-devtools-preview/9mzbfrmz0mnj?activetab=pivot:overviewtab to remote debug the running app and look at the console of the webview, maybe this can tell you what is going wrong there. (Super difficult to help here without having the actual app.)