How can I fix build procedure for Tauri app on Windows? - windows

I am an absolute beginner to to Tauri apps while building applications using Rust and NextJS (For UI). I am currently creating a Desktop app that is cross platform. The code compiles successfully. I use npm run tauri build to create builds for the application. The problem is that this command successfully builds .deb packages for Linux distros and .dmg for Macos. But fails to create an MSI installer for Windows.
I am sharing the logs for the build on Github actions. I was under the impression that this problem was probably only occuring on my code and my PC. But it seems it was failing on Github actions as well.
Compiling tauri-app v1.0.0 (D:\a\tauri-app\tauri-app\src-tauri)
Finished release \[optimized\] target(s) in 9m 35s
Info Verifying wix package
Downloading https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip
Info validating hash
Info extracting WIX
Info Target: x64
Running candle for "main.wxs"
Error failed to bundle project: error running candle.exe: error running candle.exe: `failed to run C:\Users\runneradmin\AppData\Local\tauri/WixTools\candle.exe`
I have followed all the steps as specified in the documentation by Tauri at Tauri documentation. And also did exactly what was stated here at Cross platform compilation. This could be a bug from Tauri as well. Because wix is failing instantly. I have tried removing WixTools from the directory as it automatically downloads it. But had no luck! So if anyone can help me out with this, that would be perfect!

Related

AWS SDK in Visual Studio always exits with a message of saying that it didn't raise a CoreCLR started event [duplicate]

I've been working with AWS lambdas for a few months. I was working with a lambda and it was fine at the end of the day. I came back to work on it the next day, and I can't get Visual Studio to even start the application using the Mock Lambda Test Tool.
I ended up creating an empty lambda that just returns the input (the standard project code that AWS gives you as a template) and that won't even run. I hit the play button to star the Mock Lambda Test Tool, it looks like it will run for a couple seconds, then it closes down. The command window does not even pop up.
This is the code from the template project.
public string FunctionHandler(string input, ILambdaContext context)
{
return input?.ToUpper();
}
This is all I get in the output window of VS:
The target process exited without raising a CoreCLR started event.
Ensure that the target process is configured to use .NET Core. This
may be expected if the target process did not run on .NET Core. The
program '[16700] dotnet-lambda-test-tool-2.1.exe: Program Trace' has
exited with code 0 (0x0). The program '[16700]
dotnet-lambda-test-tool-2.1.exe' has exited with code -2147450726
(0x8000809a).
I have tried re-installing the AWS toolkit, and also tried re-installing Visual Studio. This is an issue with VS 2017 and VS 2019. I just installed 2019 to see if that would fix the issue. Any help would be appreciated.
I came to this question having the very same issue. After installing AWS Toolkit I found that the lambda test tool was not installed and therefore I got the same error just as the OP. The only difference is that I was targeting .Net Core 3.1 and therefore I needed amazon.lambda.testool-3.1. However this answer should work for both scenarios.
Unfortunately I did not have the same luck as the OP of having a nice co-worker that could give me the files I needed. So, if this is also your case please continue reading.
In the official project site, which can be found here, there are the instructions to install the tools. It also says that installing the latest version of AWS Toolkit should be enough to have the tools installed (it was not in my case and probably in yours).
It says that in order to install the tools you should run the following commands:
dotnet tool install -g Amazon.Lambda.TestTool-3.1
or
dotnet tool install -g Amazon.Lambda.TestTool-2.1
depending on which tool you need.
However, running these commands fails with the following message:
The tool package could not be restored.
Tool 'amazon.lambda.testtool-2.1' failed to install. This failure may have been caused by:
* You are attempting to install a preview release and did not use the --version option to specify the version.
* A package by this name was found, but it was not a .NET Core tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
* You mistyped the name of the tool.
For more reasons, including package naming enforcement, visit https://aka.ms/failure-installing-tool
And since the project is still in preview I just had to find the latest stable version in order to specify it in the command. For .net core 3.1 here is the nuget site, there I found version 0.10 to be the latest, so the command should look like:
dotnet tool install -g --version 0.10 Amazon.Lambda.TestTool-3.1
I have faced the same issue and when i tried to install dotnet-lambda-test-tool-3.1.exe using command prompt I got this issue:
Failed to create shell shim for tool 'amazon.lambda.testtool-3.1': Command 'dotnet-lambda-test-tool-3.1' conflicts with an existing command from another tool.
Tool 'amazon.lambda.testtool-3.1' failed to install.
And I did the following to fix issue
Deleted the dotnet-lamda-test-tool-3.1.exe from the installed folder (C:\Users%USERNAME%.dotnet\tools\dotnet-lambda-test-tool-3.1.exe)
Run dotnet tool install -g --version 0.10 Amazon.Lambda.TestTool-3.1 on cmd.
I have faced the same issue and got errors like "dotnet-lamda-test-tool-2.1.exe has exited with code.."
I did the following to fix the issue
Removed the dotnet-lamda-test-tool-2.1.exe from the installed folder
(C:\Users%USERNAME%.dotnet\tools\dotnet-lambda-test-tool-2.1.exe)
Removed the [amazon.lambda.testtool-2.1] folder as well
(C:\Users%USERNAME%.dotnet\tools\tools.store\amazon.lambda.testtool-2.1)
Installed dotnet tool from Developer command prompt using the command
[install -g Amazon.Lambda.TestTool-2.1]
Run the project. It is working
I have seen this issue many time on my system with dotnet-lambda-test-tool-6.0. Only one fix work for me
Remove dotnet-lambda-test-tool-6.0.exe from C:\Users\username.dotnet\tools
Open Command prompt from C:\Users\username.dotnet\tools
run command dotnet tool install -g Amazon.Lambda.TestTool-6.0
For anyone else that hits this same issue, it had to do with the the AWS toolkit install. I did not modify it, but somehow it was no longer working. I tried un-installing and re-installing, but it was still having issues running it. A co-worker sent me the exe and subdirectory that was setup on his machine under C:\Users\%user%.dotnet\tools. The exe is located in this directory, and there is another folder under .store for amazon.lambda.testtool-2.1. That directory had different folders and files than what I was able to install. So I copied in what he had and it worked. There might be a profile file associated to the tools install that points to these folders and files that might need to be modified. Since I was able to fix it with this, I didnt look any further into that.
I had the same issue with my .NET 6.0 lambda project. I installed the tool by executing dotnet tool install --global Amazon.Lambda.TestTool-6.0 --version 0.12.6 as suggested on https://www.nuget.org/packages/Amazon.Lambda.TestTool-6.0
Just ensure it is installed at %USERPROFILE%\.dotnet\tools\dotnet-lambda-test-tool-6.0.exe
I got the same issue with VS2019 with lambda design in 3.1 version and in Output window getting error
The target process exited without raising a CoreCLR started event. Ensure that the target process is configured to use .NET Core. This may be expected if the target process did not run on .NET Core.
Then checked the folder having multiple version of lambda-test-tool in path
C:\Users{username}.dotnet\tools
I removed all the lambda-test-tool and installed the required tool only with version 3.1 by command in developer command prompt:
dotnet tool install -g --version 0.10 Amazon.Lambda.TestTool-3.1
Then I can able to debug the lambda

Flutter .exe Release not running on Windows

When I build flutter for windows with flutter build windows it generates a .exe file with its .dll files etc. However, running that file (.exe) gives me a white screen and my app is not running normally.
Running flutter run --release -d windows however builds my app normally and I can use it.
What is wrong here that running the .exe file is not starting my app properly?
This is my release folder structure when running flutter build windows:
Running the .exe file:
I was using sqflite_common_ffi on Windows and this was causing the issue. Initializing it was only valid for debug thus I had to add the sqlite3.dll to the release build folder. Then it worked fine like before when starting the .exe file.
Detailed description can be found here: https://github.com/tekartik/sqflite/issues/574

Electron: Sharing the same project folder between macOS and Windows

Goal
I've read many Electron tutorials about app bootstrapping and build pipeline and had assumed that you could have a single project to handle a cross-platform action.
But after numerous failures in the packaging and build process, I finally realized that maybe my assumption is wrong.
Problem
Here is my desired workflow based on electron-forge:
1. Create app skeleton on Windows
yarn create electron-app my-app
cd my-app
yarn add my-dependency
yarn start
yarn make
This all went well. Now onto macOS
2. Transfer project to macOS for a ride
On macOS, running the app will lead to an error
cd my-app
yarn start
The error looks like this
$ yarn start
yarn run v1.22.4
$ electron-forge start
✔ Checking your system
✔ Locating Application
✔ Preparing native dependencies: 1 / 1
✔ Launching Application
/path/to/my-app/node_modules/electron/dist/electron.exe: /path/to/my-app/node_modules/electron/dist/electron.exe: cannot execute binary file
error Command failed with exit code 126.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
So I blindly reinstall electron on macOS
yarn add electron
yarn start
yarn make
Things work fine on macOS.
Now back to Windows.
3. Travel back to Windows to double-check
This time. I got the similar problem as in Step #2. The Windows distribution now has the wrong Electron binary.
Findings
I found this file constantly getting overwritten even if I merge carefully when transferring project files between Windows and macOS.
my-app/node_modules/electron/path.txt
It contains a hardcoded path to Electron executable:
macOS
Electron.app/Contents/MacOS/Electron
Windows:
electron.exe
Workarounds
I could add pre-build steps against this by copying predefined metadata to the project folder depending on the current platform. But a hack like this sounds lame for a framework like Electron.
Question
So to me this metadata arrangement makes it difficult to share the same project between Windows and macOS. I can't imagine Electron developers working like this.
So What am I missing?
Basically, you shouldn't commit node_modules at all. Some post installation scripts may compile packages for a specific OS and the folder is usually huge.
Also, you shouldn't commit any result of a build, package or compile command. Typically, dist folders should be ignored.
Your repository should only contains code and configuration files.
The idea is that it makes no sense to commit these files and folders as you have all the required steps in order to reproduce the result on any machine: your windows computer, your macOS computer, your CI environment, etc. For example (these are pseudo-commands):
npm i or npm ci
npm run build
electron package
etc
So you should add all these folders to you .gitignore file:
# compiled output
/dist
/tmp
/out-tsc
/packages
# dependencies
/node_modules

how to fix Archive Runner fail in flutter?

I made an app using a flutter and I want to distribute it to the app store. However, if I run archive, It has fail.
flutter clean
flutter getpackage
flutter upgrade and update
product clean in xcode
but I has success product -> build
just when I distribute the app to archive. I got fails...
Building AOT snapshot in release mode (ios-release)...
Dart snapshot generator failed with exit code -9
Building AOT snapshot in release mode (ios-release)... 309.0s (!)
Built to build/aot/.
Snapshotting (IOSArch.arm64) exited with non-zero exit code: -9
cp: build/aot/App.framework: No such file or directory
error: cannot parse the debug map for 'build/aot/App.framework/App': No such file or directory
Failed to generate debug symbols (dSYM) file for build/aot/App.framework/App.
You need to run "flutter build ios" before use the code in Xcode
Check the docs: https://flutter.dev/docs/deployment/ios
I solved this problem.
I made so many .dart files
so I spend a lot of time doing compile.
the problem is that there are many dart files
We need to reduce the dart file.
I built the release version and it was successful, leaving only the main files behind.
So the unnecessary dart file was erased and the build was successful.
But I don't think this is a fundamental solution.
I will continue to develop and make dart files. Then you'll face a situation where you don't build again.

Running qtcreator 4.0.1 on a lxc-container

Using this link I created a container and after getting some packages, I want to start a qtcreator 4.0.1 on it. I use a ssh connection to connect to the container. After launching qtcreator I get an error such as this:
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, xcb.
Reinstalling the application may fix this problem.
I installed all prerequisites packages as listed here but still the problem is remained.
I must mention that I am using a privileged container in opposite of the link.
xcb listed as available plug-ins but it does not run. Is there any suggestion to get around this bug?
This answer has the main solution. In my case I find the libqxcb.so in path /path_to_qt/plugins/platforms/ and after running ldd command on it I found that it has not one of its dependency libEGL.so after install this package using sudo apt install libegl-mesa0-dev I could run qtcreator.

Resources