Hi,
i'm trying to port an existing iOS/Android Ionic Application to Windows. The application uses cordova-sqlite-storage.
Unfortunetly it does not work out of the box. (_quelle surprise_)
My setup:
Cordova CLI: 6.5.0
Ionic Framework Version: 2.2.0
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.1.4
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.10.2
Executed steps:
# git clone ...
# npm install
# ionic platform add windows
# ionic prepare
# ionic build windows --buildConfig build.json --archs=x86
This is what I get as the result of the build step:
Building project: C:\dev\x\platforms\windows\CordovaApp.Windows10.jsproj
Configuration : debug
Platform : x86
Patching 10 in prebuild event...
Injected base.js reference to the /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:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(724,5):
error : The OutputPath property is not set for project 'SQLite3.UWP.vcxproj'.
Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.
Configuration='debug' Platform='Win32'.
You may be seeing this message because you are trying to build a project without a solution file,
and have specified a non-default Configuration or Platform that doesn't exist for this project.
[C:\dev\x\plugins\cordova-sqlite-storage\src\windows\SQLite3-Win-RT\SQLite3\SQLite3.UWP\SQLite3.UWP.vcxproj]
Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe: Command failed with exit code 1
I manually tried to change the <PlatformToolset> from v141 to v140 but this change gave me another error.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(1954,3):
error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v14.0\Microsoft.Windows.UI.Xaml.Cpp.targets" was not found.
Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
[C:\dev\x\plugins\cordova-sqlite-storage\src\windows\SQLite3-Win-RT\SQLite3\SQLite3.UWP\SQLite3.UWP.vcxproj]
Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe: Command failed with exit code 1
Any ideas?
Thank you.
Did you try building with Visual Studio?
I also change the PlatformToolset from v141 to v140 but i have the following error on trying to build on Windows.
Exception was thrown at line 126, column 7 in ms-appx://com.app.project/www/plugins/cordova-sqlite-storage/src/windows/SQLite3-Win-RT/SQLite3JS/js/SQLite3.js
0x800a1391 - JavaScript runtime error: 'SQLite3' is undefined
It seems that SQLite3 is undefined in the process. Can anyone help?
Changing PlatformToolseet to v140 will never work on Visual Studio 2017.
Can you guys try the following:
The build works with VS 2017 after I changed the Platform-Toolset from v140 to v141.
The cordova build fails:
$ cordova build windows
Building project: C:\dev\cordova-sqlite-storage-starter-app\platforms\windows\CordovaApp.Windows.jsproj
Configuration : debug
Platform : anycpu
Patching 8.1 in prebuild event...
Injected base.js reference to the www/index.html
Removing /( *)(<script\s+(?:type="text\/javascript"\s+)?src="\/www\/WinJS\/js\/base.js">\s*<\/script>)(\s*)/ from www/in
dex.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:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(2049,5):
error MSB3774: Could not find SDK "Microsoft.WinJS.2.0, Version=1.0".
[C:\dev\cordova-sqlite-storage-starter-app\platforms\windows\CordovaApp.Windows.jspro j]
Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe: Command failed with exit code 1
Edit:
After adding
<platform name="windows">
<preference name="windows-target-version" value="10.0" />
</platform>
to the config.xml it fails with the same OutputPath Error as written above.
The output shows that you are building for the "AnyCPU" target which is not supported with this plugin.
You may want to look at how we did this in #580 (it took us several tries to get it right).
Okay, the sample project builds now. Thanks.
I just applied set VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise and it worked.
For my project this is unfortunately not enough. :(
I'm now stuck with this:
chja@DESKTOP-COVMU4V C:\dev\x
> set VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise
chja@DESKTOP-COVMU4V C:\dev\x
> cordova build windows -- --release --archs="x86" --appx uap
The following navigation rule had an invalid URI scheme and will be ignored: "mailto:*".
The following image was skipped because it has an unsupported size (undefinedxundefined): resources/ios/icon/[email protected]
Running command: "C:\Program Files (x86)\nodejs\node.exe" C:\dev\14Q-tablet\hooks\after_prepare\010_add_platform_class.js C:\dev\x
add to body class: platform-windows
Building project: C:\dev\x\platforms\windows\CordovaApp.Windows10.jsproj
Configuration : debug
Platform : x86
Patching 10 in prebuild event...
Injected base.js reference to the /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
SQLite3.UWP.vcxproj -> C:\dev\x\plugins\cordova-sqlite-storage\src\windows\SQLite3-Win-RT\SQLite3\SQLite3.UWP\debug\SQLite3.UWP\SQLite3.UWP.dll
SQLite3.UWP.vcxproj -> C:\dev\x\plugins\cordova-sqlite-storage\src\windows\SQLite3-Win-RT\SQLite3\SQLite3.UWP\debug\SQLite3.UWP\SQLite3.UWP.pdb (Partial PDB)
Das System kann den angegebenen Pfad nicht finden. (Something like path can't be found)
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\TypeScript\Microsoft.TypeScript.Uap.targets(78,5): error MSB3073: The comma nd ""*Undefined*\CommonExtensions\Microsoft\TypeScript\WinRt2ts.exe" @"build\windows\bld\winrtrefs\winrt2ts.rsp"" exited with code 3.
[C:\dev\x\platforms\windows\Cord ovaApp.Windows10.jsproj]
Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe: Command failed with exit code 1
>
It looks like some path is undefined?
I can think of a couple ways forward for you:
Building with Visual Studio 2017 works for me
This is fixed, follow the bellow steps
You can add a file 'CordovaApp.Windows10.jsproj.user' into appdir/platforms/windows/
with this xml content:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<DevEnvDir>$(VSINSTALLDIR)\Common7\IDE</DevEnvDir>
</PropertyGroup>
</Project>
The error is caused by DevEnvDir variable not being set and this .user file will ensure the variable is set for the project.
@jayeshust at what timing did you add the SQLite plugin before build?