I am new to apache cordova and i'm trying to build a client app for my asp.net mvc website, using apache cordova in visual studio.
but visual studio 2017 tools for apache cordova installs cordova 6.3.1 and some plugins like onesignal can't work on it.
Could you please help me?
That is a known issue but it can be fixed following these steps:
Assuming you have already installed Cordova 7.1.0 gobally using npm install -g cordova#7.1.0
In Visual Studio 2017 go to File > New > Project > Blank App (Apache Cordova)
Open config.xml in View Code mode and find this:
<vs:toolsetVersion>6.3.1</vs:toolsetVersion>
<engine name="android" spec="5.2.1" />
Replace with:
<vs:toolsetVersion>7.1.0</vs:toolsetVersion>
<engine name="android" spec="6.3.0" />
Where 7.1.0 is your global Cordova version.
Note how cordova-android has been increased to 6.3.0 as well.
Feel free to try using cordova-android 6.4.0 or cordova-android 7.0.0, however they may or may not introduce some issues (with Gradle for example). I have tested 6.3.0 but certain plugins may require a newer version.
Select Device as target.
Now Build > Build Solution
Save, close and reload the project. When you access config.xml in designer mode you'll see Global Cordova 7.1.0 as the selected toolset.
In order to build you may need to use the external Android SDK Build Tools (API 26) instead of the ones provided by Visual Studio (API 25).
Use the Android SDK Manager to manage versions, no need to get Android Studio for this.
Remember to follow the guidelines from Microsoft when changing the CLI on existing projects. However I strongly recommend creating a new one and then importing your files and adding your plugins to avoid potential problems.
Related
I wanted to start coding something using .NET MAUI, so I updated my VS2022 to "Version 17.1.0 Preview 6.0".
Then I installed these features using "Visual Studio Installer" as suggested in https://learn.microsoft.com/en-us/dotnet/maui/get-started/installation
Unfortunately when I create a basic MAUI app, I get several errors like this:
Error NU1012 Platform version is not present for one or more target
frameworks, even though they have specified a platform: net6.0-android
On developer command line I tried running dotnet workload list and got
android
ios
maui-android
maui-maccatalyst
If I try to install some other workload (eg maui or maui-windows) I get an error stating
Unable to download manifest microsoft.net.workload.emscripten:
microsoft.net.workload.emscripten.manifest-6.0.200 has not been found
on NuGet feeds https://api.nuget.org/v3/index.json, C:\Program Files
(x86)\Microsoft SDKs\NuGetPackages"
I've also tried to completely remove and reinstall VS2022, without any luck.
I've then tried to run maui-check but when it tries to download Recommendation: Download .NET SDK (6.0.200) the exe is not valid and the task fails.
Worst part: I tried to install a fresh VS2022 preview on a different pc and everything works flawlessly... but I need it to work on my developmente pc!
.
I am trying to build Microsoft.AspnetCore.Identity from sources. The instructions are here: https://github.com/dotnet/aspnetcore/blob/master/docs/BuildFromSource.md. I am trying to run their command "restore.cmd" and hitting the following error:
error : Version 3.1.10 2 of the .NET Core SDK requires at least version 16.3.0 of MSBuild. The current available version of MSBuild is 16.0.46
1.62831. Change the .NET Core SDK specified in global.json to an older version that requires the MSBuild version currently available.
The error message's suggestion of changing the .Net Core SDK version seems absurd. Surely the solution is to install MSBuild 16.3.0. But how do I do that?
As an aside which may or may not be relevant, the instructions also have a script for installing the "exact required" version of VS. But it seems to install a new one that goes side-by-side with my existing version. Their "startvs" command then starts the existing one, rather than the new one. It has to be better to add everything needed to the existing installation. But I'm missing how to add MSBuild 16.3.0.
The error message's suggestion of changing the .Net Core SDK version
seems absurd. Surely the solution is to install MSBuild 16.3.0. But
how do I do that?
1) Please make sure that you have run ./eng/scripts/InstallVisualStudio.ps1 to install the required tools.
2) If you have VS2019, try to enable the option Use previews of the .NET Core SDK(require restart) under Tools--> Options-->Environment-->Preview Features.
a) If you have VS2019 at your agent, just update it to the latest version so that you will get the latest version about MSBuild.
b) Download the latest version of Build Tool for VS2019. You can download it under Tools for Visual Studio 2019 from this link. If you have already downloaded it, please update it to the latest version in vs installer. Also, make sure that you have install the workload Net Core build tools. After that, you can build net core projects with it.
3) Then try to run .\restore.cmd in developer command prompt.
I have installed Visual Studio 2017 Community Edition. Installed it without any specific things selected like C++ development or Windows development etc. After that I have installed Wix through wixtoolset, which downloaded and installed wix tool set components. After that I have installed the Wix ToolSet extension for Visual Studio 2017. Restarted the Visual Studio and trying to create a new project through File -> New -> Project - WiX Toolset -> Setup Project.
It gives the error and does not let me create the project. I am totally new to WiX and have just a little knowledge about Visual Studio.
Initially, I did not select any of the Installation workloads for VS17 and installed it just to make the installation faster.
Through the comments from Azaz, I came to know that NuGet Package Manager is required to install the packages on demand. But since I could not see the NuGet option at all, I tried to install it with Extensions and updates but it did not work. I did a bit of research and found that at least one .Net development workload is required at a time of VS17 installation which will make the NuGet install automatically in VS17.
So I uninstalled the VS17, WiX at all and removed them from the system. Then Installed VS17 with certain workload packages as shown in the below screenshot.
After that I installed WiX and an extension for the same in VS17. i.e. Votive2017.vsix.
I restart the VS17 and now I am able to create project for WiX.
Looks like there is something I missed somewhere in installing which did not let me install required DLLs and GUID feature, which were important for creating project templates.
Sharing the steps I followed in order to fix the same issue that I found with Visual Studio 2019, as I also installed it without any workload. I was also looking at a reduced installation.
The steps I did in order to fix the template error, install the following individual components:
.NET 5.0 Runtime
.Net Core 3.1 Runtime
.NET SDK
C# and Visual Baisc Roslyn compilers
ClickOnce Publishing
Microsoft Visual Studio Installer Projects
Hope it helps someone else. I have to point out that the comments before helped me understand the issue. But, for example, I couldn't even open the NuGet command line.
I just wanted to know how the worklight folder is compiled and copied inside the wlapp file. I am referring to the worklight folder which consists of the cordova plugins folder, worklight.js, cordova_plugins.js, etc.
These files are used during build-time by the Worklight Build Engine. They are located in the TMPDIR of your OS. Since you're using OS X you can open Terminal and run the command open $TMPDIR/wlBuildResources (> your-WL-version\jslibexpanded).
I am guessing you are asking this because you are thinking of altering these files pre-build time? You must not do that as it may generate a faulty application (it does not go only to the wlapp file but also to the generated native project of any mobile environment you may have added to your application).
These resources are also deleted and re-created on each launch of Eclipse (with Worklight Studio installed).
This will of course also void any support requests.
Since this is probably related to your other question about using the Ionic Keyboard Cordova plug-in, note that in the upcoming MobileFirst Platform Foundation 7.1 there is Cordova application support, enabling you to create either an iOS or Android application with MPF as a plug-in like any other, thus you can also leverage any Cordova plug-in that you would like. More on this, soon, once 7.1 is released.
I just installed a new Worklight 6.1 environment (Studio).
I got a brand new Eclipse 4.3.1 and installed Worklight 6.1 plugin on top of that.
Then I downloaded Android SDK and Tools.
When I created my first sample project and added Android environment, automatically the tool set the Android target SDK to 19, which I actually I don't have installed, so I got an error.
I then changed the following line in AndroidManifest.xml to my desired target SDK:
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="15"/>
but building Android environment, I receive following message:
It is recommended that your Android application will target the same API level used to build the android project. The API
level used to compile the project is specified as the Project Build Target in Project / Properties / Android dialog. Configure your application
to target the same API level by setting the same value in android:targetSdkVersion attribute in AndroidManifest.xml.
So it seems that changing the target SDK in AndroidManifest.xml is not enough, but I can't find this : Project Build Target in Project / Properties / Android dialog.
Any advice is most welcome.
Giovanni
The Project Build target you are referring to appears in the properties of the Android project and not the Worklight project.
Alternative, you may update in the main project
apps/appName/android/native/project.properties.
You'll also need to take care of AndroidManifest.xml.
project.properties has this contradictory notice (as pointed out by this question), but it is safe to edit it.
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.