I’m using the LexActivator Flutter package. For the Mac OS build I was able to get it working by installing the dylib file in XCode manually, linking it, etc. On Windows I’m able to run/debug the app in Visual Studio Code, and all of the LexActivator package features work. However, after creating an MSIX package of our app, and installing & running it, the LexActivator functions hang. For instance, this hangs:
I believe it is. I have both Visual Studio Code and Visual Studio 2022 installed on the machine. I’m not sure if this is what you’re asking, but the Visual C++ 2015-2022 Redistributable is installed as well as .NET 7.0 Runtime.
I’m having a hard time locating where the application gets installed using the MSIX package. It’s not installed in the usual C:\ProgramFiles… folder. A folder gets created here:
If I change the .msix file to .zip and decompress it, I can see there are several .dlls inside, including: LexActivator.dll and lexactivator_plugin.dll. I’ve attached a screenshot showing the contents of the msix folder. I’m not sure if this helps?
This is also something we suspected. The LexActivator.dll file is essential for the program to run on Windows. When packaging, you have to ensure that the file is available for the program to use in its execution path.
Can you try using a different method for packaging the application and get back?
Edit: Since I suspect the issue to be with the msix packaging step, you could also try looking into the configuration for the msix package to ensure that the dll is being shipped with your application.
I think I figured it out. In the LexActivator Dart package, is this function:
static DynamicLibrary loadLib() {
final libraryPathURI = File(Platform.resolvedExecutable).parent.uri;
if (Platform.isLinux) {
return DynamicLibrary.open(
libraryPathURI.resolve('lib/libLexActivator.so').path);
} else if (Platform.isWindows) {
return DynamicLibrary.open(Platform.script
.resolve("build/windows/Runner/Debug/LexActivator.dll")
.toFilePath(windows: true));
} else if (Platform.isMacOS) {
return DynamicLibrary.open('libLexActivator.dylib');
} else if (Platform.isAndroid) {
return DynamicLibrary.open('libLexActivator.dylib');
} else if (Platform.isAndroid) {
return DynamicLibrary.open('libLexActivator.dylib');
} else {
throw Exception();
}
}
The path build/windows/Runner/Debug/LexActivator.dll doesn’t exist in the packaged MSIX. This works in debug mode, because that path does exist. Changing it to just LexActivator.dll instead seems to fix the issue in both modes.