Problem with building exe from JavaFX project - javafx

I have a problem with building exe from JavaFX project. I created artifact with necessary parameters. Set application class, choose "all" in native bundle.
I getting next error when building:
Java FX Packager:
BUILD FAILED
PATH: Error: Bundler "Windows Application Image" (windows.app) failed to produce a bundle.
When i choose "exe" in native bundle, build completes successfully but the exe file is not created. How i can resolve this problem?
SDK: BellSoft Liberica version 11.0.15

Related

Assets file project.assets.json doesn't have a target for 'net6.0-windows10.0.19041.0/win-x64'

I have a .NET 6 Windows Desktop app that I deploy with MSIX.
I can run and debug it on my own computer, but it fails to build with Azure Pipelines YAML.
I get the error:
C:\Program
Files\dotnet\sdk\6.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(267,5):
error NETSDK1047: Assets file 'D:\a\1\s\MyApp\obj\project.assets.json'
doesn't have a target for 'net6.0-windows10.0.19041.0/win-x64'. Ensure
that restore has run and that you have included
'net6.0-windows10.0.19041.0' in the TargetFrameworks for your project.
You may also need to include 'win-x64' in your project's
RuntimeIdentifiers.
App project file:
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
<Platforms>x64</Platforms>
Installer project file:
<TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
The pipeline task is VSBuild with Visual Studio 2022 (v. 17)
Nuget tool is version 6.0 installed with NugetToolInstaller task.
Azure Windows agent uses vmImage: 'windows-2022'
The error says:
Ensure that you have included 'net6.0-windows10.0.19041.0' in the
TargetFrameworks for your project. You may also need to include
'win-x64' in your project's RuntimeIdentifiers.
I have added 'net6.0-windows10.0.19041.0' in the TargetFramework for both the app and the installer projects.
If I replace win10-x64 with win-x64 it can build, but I need to use win10-x64 because one of the packages requires it (Microsoft.PowerShell.SDK with System.Management.Automation).
NEW:
After adding /p:RestoreLockedMode=true in the VS Build task, I now get the error:
MyApp.Installer.wapproj : error NU1004: The project MyApp has no
compatible target framework. The packages lock file is inconsistent
with the project dependencies so restore can't be run in locked mode.
Disable the RestoreLockedMode MSBuild property or pass an explicit
--force-evaluate option to run restore to update the lock file.
NEW NEW: I upgraded to .NET 7 but get the same error.
How do I fix the error?

Build failing for Android after updating xamarin.forms

I have a Xamarin.Forms app. Yesterday, I updated Xamarin.Forms package to the latest version 4.8.0.1687. In Visual Studio 2019 I can build the app and run it. But build in Azure DevOps pipeline fails. For Android, the following error is reported:
C:\Program Files\dotnet\sdk\5.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(241,5): error NETSDK1005: Assets file 'D:\a\1\s\My_MobileApp\My_MobileApp\obj\project.assets.json' doesn't have a target for 'netstandard2.0'. Ensure that restore has run and that you have included 'netstandard2.0' in the TargetFrameworks for your project. [D:\a\1\s\My_MobileApp\My_MobileApp\My_MobileApp.csproj]
Where My_MobileApp is the shared project.
I checked the project file, but the Target Framework there is set to .NET Standard 2.0. I checked the project.assets.json in the local obj folder, and it has
"originalTargetFrameworks": [
"netstandard2.0"
],
But no "TargetFrameworks".
What is wrong, and how this can be fixed?
Updating nuget to 5.8 worked for me

An assembly specified in the application dependencies manifest (<my-project>.deps.json) was not found

When I run:
dotnet ef migrations add InitialCreate
It errors:
Error:
An assembly specified in the application dependencies manifest (idb-dialog-flow.deps.json) was not found:
package: 'idb-dialog-flow', version: '1.0.0'
path: 'idb-dialog-flow.dll'
Here is a link to my project: https://github.com/islaam-database/chatbot.
How do I get this to work?
Edit: I forgot to mention that this project is an Azure Function.
I was able to find a workaround. I created a new project under the same solution. It was a library class project. I ran the entity framework commands in that project and it worked. I then imported that project into my first project and the DB calls were successful.

How to Build Android project that uses Xamarin.Forms.Maps?

I created a new Xamarin Forms solution with .Net Standard 2.0
It builds OK.
Then I add a NuGet Xamarin.Forms.Maps:
and appear this Build error:
Severity Code Description Project File Line Suppression State
Error An error occurred trying to install required android components on Project 'eCidadaoMobile.Android'.
Project 'eCidadaoMobile.Android' requires the following components installed on your machine:
Xamarin.GooglePlayServices.Base
JavaLibraryReference: https://dl-ssl.google.com/android/repository/google_m2repository_r24.zip-m2repository/com/google/android/gms/play-services-base/8.4.0/play-services-base-8.4.0.aar-8.4.0
AndroidResources: https://dl-ssl.google.com/android/repository/google_m2repository_r24.zip-m2repository/com/google/android/gms/play-services-base/8.4.0/play-services-base-8.4.0.aar-8.4.0
Xamarin.GooglePlayServices.Basement
JavaLibraryReference: https://dl-ssl.google.com/android/repository/google_m2repository_r24.zip-m2repository/com/google/android/gms/play-services-basement/8.4.0/play-services-basement-8.4.0.aar-8.4.0
AndroidResources: https://dl-ssl.google.com/android/repository/google_m2repository_r24.zip-m2repository/com/google/android/gms/play-services-basement/8.4.0/play-services-basement-8.4.0.aar-8.4.0
Xamarin.GooglePlayServices.Maps
JavaLibraryReference: https://dl-ssl.google.com/android/repository/google_m2repository_r24.zip-m2repository/com/google/android/gms/play-services-maps/8.4.0/play-services-maps-8.4.0.aar-8.4.0
AndroidResources: https://dl-ssl.google.com/android/repository/google_m2repository_r24.zip-m2repository/com/google/android/gms/play-services-maps/8.4.0/play-services-maps-8.4.0.aar-8.4.0
Please double-click here to install it.
Intallation Errors: XA5207 Please install package: 'GPS Base' available in SDK installer. Java library file 'C:\Users\tonyv\AppData\Local\Xamarin\Xamarin.GooglePlayServices.Base\8.4.0\embedded\classes.jar' doesn't exist.
XA5207 Please install package: 'GPS Basement' available in SDK installer. Java library file 'C:\Users\tonyv\AppData\Local\Xamarin\Xamarin.GooglePlayServices.Basement\8.4.0\content\classes.jar' doesn't exist.
XA5207 Please install package: 'GPS Maps' available in SDK installer. Java library file 'C:\Users\tonyv\AppData\Local\Xamarin\Xamarin.GooglePlayServices.Maps\8.4.0\content\classes.jar' doesn't exist. 0
If I double-click the error message, nothing happens.
How and where to install these required files?
Under the path C:\Users\UserName\AppData\Local\Xamarin, delete the Xamarin.GooglePlayServices folders, in order to redownload them during the next startup.

GIT based asp.net web app fails to deploy to Azure with typescript compile error

I have this asp.net (4.6.2) web application which compiles and runs fine on my local machine.
The project is in a Git repo in VSTS.
I want this site deployed to Azure web sites. So I make a Webapp and set the deployment option to my VSTS Git repo.
This will automatically trigger a deployment... which fails.. with this error:
All packages listed in packages.config are already installed.
D:\home\site\repository\FormBuilder\Scripts\typings\knockout\knockout.d.ts(335,13): error TS1110: Build: Type expected. [D:\home\site\repository\FormBuilder\FormBuilder.csproj]
D:\home\site\repository\FormBuilder\Scripts\typings\knockout\knockout.d.ts(338,11): error TS1109: Build: Expression expected. [D:\home\site\repository\FormBuilder\FormBuilder.csproj]
D:\home\site\repository\FormBuilder\Scripts\typings\knockout\knockout.d.ts(339,1): error TS1128: Build: Declaration or statement expected. [D:\home\site\repository\FormBuilder\FormBuilder.csproj]
Failed exitCode=1, command="D:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" "D:\home\site\repository\FormBuilder\FormBuilder.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="D:\local\Temp\8d3e9219d2f6f3b";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false /p:SolutionDir="D:\home\site\repository.\"
An error has occurred during web site deployment.
It looks to me like it's compiling my .d.ts files. Don't know why..VS2015 does not do that.
I tried to exclude this file in a tsconfig but that does not work.
How can I make this build succeed?
So the problem is that the Azure build machine is not equipped with typescript 2.0 (yet) and knockout.d.ts uses a 2.0 syntax for something. See the comments below the question.
GitHub issue here
You need to compile type script files before deploying to azure. In deploy.cmd file on azure you can add this code to Compile TypeScript right after the npm packages are installed.
echo Transpiling TypeScript in %DEPLOYMENT_TARGET%...call :ExecuteCmd node %DEPLOYMENT_TARGET%\node_modules\typescript\bin\tsc -p "%DEPLOYMENT_TARGET%"
You can find the deploy.cmd file on KUDU in site->deployments->tools section.

Resources