Flutter js unit test - flutter

I have a flutter test project which depends on futter js (javascript environment) this, I wrote a unit test to it. But I keep getting error on this line
jsRuntime = getJavascriptRuntime();
Invalid argument(s): Failed to load dynamic library 'quickjs_c_bridge.dll': error code 126
dart:ffi new DynamicLibrary.open
package:flutter_js/quickjs/ffi.dart 118:26 _qjsLib
package:flutter_js/quickjs/ffi.dart _qjsLib
package:flutter_js/quickjs/ffi.dart 163:19 _jsNewRuntime
package:flutter_js/quickjs/ffi.dart _jsNewRuntime
package:flutter_js/quickjs/ffi.dart 206:14 jsNewRuntime
package:flutter_js/quickjs/quickjs_runtime2.dart 51:16 QuickJsRuntime2._ensureEngine
package:flutter_js/quickjs/quickjs_runtime2.dart 165:5 QuickJsRuntime2.evaluate
package:flutter_js/quickjs/quickjs_runtime2.dart 230:9 QuickJsRuntime2.initChannelFunctions
package:flutter_js/javascript_runtime.dart 63:5 JavascriptRuntime.init
package:flutter_js/quickjs/quickjs_runtime2.dart 46:10 new QuickJsRuntime2
package:flutter_js/flutter_js.dart 40:15
getJavascriptRuntime
can't figure out how to do flutter js unit test. I want some tips and if possible
Here is the reference but it is written only for windows and linux but I need it for android apk.If possible with eg:
https://github.com/abner/flutter_js

Inside your build directory, copy file runner/Release/quickjs_c_bridge.dll to runner/Debug directory.

Related

How to show PDF from .net maui app on Windows

I am just trying to show a PDF file from my .NET MAUI application on Windows and it is giving me the error below.
"System.ComponentModel.Win32Exception: 'An error occurred trying to start process 'C:\Users<username>\Documents\helpfile.pdf' with working directory 'C:\WINDOWS\system32'. The specified executable is not a valid application for this OS platform.'"
My code is below. It has worked in a WPF app but won't work here.
Process.Start("C:\\Users\\<username>\\Documents\\helpfile.pdf"); // removed the username here and above in error message
also tried: (getting helpfile.pdf from install directory)
string _asmPath = Assembly.GetExecutingAssembly().Location;
int lastIndex = _asmPath.LastIndexOf('\\');
string helpfilePath = $"{_asmPath.Substring(0, lastIndex)}\\helpfile.pdf";
ProcessStartInfo startInfo = new ProcessStartInfo(helpfilePath);
Process.Start(startInfo);
and I get a similar error:
"System.ComponentModel.Win32Exception: 'An error occurred trying to start process 'C:\Projects\SnapSignalTel\bin\Debug\net6.0-windows10.0.19041.0\win10-x64\AppX\helpfile.pdf' with working directory 'C:\WINDOWS\system32'. The specified executable is not a valid application for this OS platform.'"
How can I open this PDF document (helpfile.pdf) in a MAUI app on Win10?
Thanks for any help!
use Launcher
await Launcher.Default.OpenAsync(new OpenFileRequest("Some Title", new ReadOnlyFile(filepath)));

Test failed to load while creating a Store

I try to unit-test, but it fails to load:
dart:ffi new DynamicLibrary.open
package:objectbox/src/native/bindings/bindings.dart 21:28 loadObjectBoxLib
package:objectbox/src/native/bindings/bindings.dart 50:41 C
package:objectbox/src/native/model.dart 18:31 new Model
package:objectbox/src/native/store.dart 63:17 new Store
package:productivitie/features/to_do_listing/data/datasource/project_database_data_source_object_box.dart 23:15 new ProjectDataBaseDataSourceObjectBox.<fn>
dart:async _completeOnAsyncReturn
package:path_provider/path_provider.dart getApplicationDocumentsDirectory
Failed to load "F:\Programme\gitProgramme\productivitie\test\features\to_do_listing\data\datasource\project_database_data_source_object_box_test.dart": Invalid argument(s): Failed to load dynamic library (193)
My Constructor, where the problem occours:
21 ProjectDataBaseDataSourceObjectBox(){
22 getApplicationDocumentsDirectory().then((Directory dir){
23 store = Store(getObjectBoxModel() , directory: dir.path + '/objectbox' );
24 box = store!.box<Project>();
25 });
26
27 }
Flutter Doctor found no issues.
I build_run my models again (overwrote objectbox.g.dart file), didn't help.
My versions are:
objectbox: 0.14.0
objectbox_flutter_libs: any
path_provider: ^2.0.1
I first thought it was a problem with the path_provider, I did set a MockMethodCallHandler to return a mocked directory path if the path_provider tries to getApplicationDocumentsDirectory.
final directory = await Directory.systemTemp.createTemp();
const MethodChannel('plugins.flutter.io/path_provider').setMockMethodCallHandler((MethodCall call) async {
if(call.method == 'getApplicationDocumentsDirectory'){
return directory.path;
}
return null;
});
But that didn't help either.
The important part of the error is:
Failed to load dynamic library (193)
From the paths in your question, I assume you're running on Windows. In that case, you need to install the dynamic library so that the compiled test executable can find it. Respecting how Windows loads DLLs this can be either the same directory as where the .exe is, or a system directory. Following Dart CLI apps or Flutter desktop apps installation instructions should help:
Install objectbox-c system-wide (use "Git bash" on Windows):
bash <(curl -s https://raw.githubusercontent.com/objectbox/objectbox-dart/main/install.sh)
Copy the downloaded lib/objectbox.dll to C:\Windows\System32\ (requires admin privileges).

info: Trying to load file 'OEMFMFileList.xml' as a FM file list ... fatal error : Error: Missing package - Creating basic IoT Core Image Powershell

I am just trying to create a basic IoT core image by following this guide.
But I am always getting the below errors, whenever I run buildimage <product name> Test after building the BSP (Import-IoTBSP RPi2 C:\Downloads\RPi_BSP.zip (or) importbsp RPi2 C:\Downloads\RPi_BSP.zip
buildpkg RPi2)
info: Trying to load file 'C:\OEEWorkspace\Build\arm\InputFMs\OEMFMFileList.xml' as a FM file list ... fatal error : Error: Missing package: C:\OEEWorkspace\Build\arm\pkgs\test.OEM.Sample.cab
info: Trying to load file 'C:\OEEWorkspace\Build\arm\InputFMs\RPi2FMFileList.xml' as a FM file list ... fatal error : Error: Missing package:
I also followed this issue in GitHub, but couldn't find the exact issue. Have you ever faced any error something similar?
Huh!. It was a silly mistake. I didn't run the New-IoTCabPackage All (or) buildpkg all after building the BSP (Import-IoTBSP RPi2 C:\Downloads\RPi_BSP.zip (or) importbsp RPi2 C:\Downloads\RPi_BSP.zip
buildpkg RPi2). Hence the cab files were not pushed into the Build\arm\pkgs folder.
After running the buildpkg all I am able to see all the required cab files in the pkgs folder, thus no error. You must do the commands in the below order.
PS C:\OEE>importbsp RPi2 "C:\Users\SibeeshVenu\Downloads\RPi_BSP.zip"
PS C:\OEE>buildpkg all
PS C:\OEE>newproduct OEEIoTCore RPi2
PS C:\OEE>buildimage OEEIoTCore Test
Once that is done, you should be able to see an output as below.

Internal /bin/cp command failed. xCode compiler error

I'm working in Xcode trying to build a simple calendar app. As I tried to build and run I get this error
/Users/Zach/Downloads/Xcode-beta.app/COnonts/Developer/Toolchains/XcodeDefault.xctoolchain/
usr/bin/bitcode_strip: internal /bin/cp command failed.
Task Failed with exit 1 signal 0 {
All I know is that it gives me the error when this line is typed... It goes away when I comment it out.
let ce = NSKeyedUnarchiver.unarchiveObject(with: eventObject as Data) as! CalenderEvent
UPDATE:
I just tried to recompile and was given a new error.
"libswiftCore.dylib" couldn't be copied to "(A Document Being Saved BY Xcode)".
It appears like something is wrong with the swift std library. It randomly switches between the two errors.
I get this same error when I run low on disk space. Try moving the project to a different location, with more space, clean the project, and re-build.

Model Error: It appears that build process was unable to locate some Utility(e.g. make,compiler,linker, etc.)

I am new to S-Functions and Real TIme WorkShop. The S-Function has been created using an Embedded Matlab Function. The S-Function Works fine, but when i try to build the same, i get the following error report:
It appears that the build process was unable to locate some utility (e.g. make, compiler, linker, etc.). Please verify your path and tool environment variables are correct. You should be able to execute the make command: .\Radius_S_func2.bat at an MS DOS Command Prompt in the directory: C:\Users\skaushik\Desktop\Matlab Models\WIP\TESTs\Sfunc_2\Radius_S_func2_Source Currently, this generates the following error:
C:\Users\skaushik\Desktop\Matlab Models\WIP\TESTs\Sfunc_2\Radius_S_func2_Source>set MATLAB=C:\MATLAB\R2010b
C:\Users\skaushik\Desktop\Matlab Models\WIP\TESTs\Sfunc_2\Radius_S_func2_Source>.......\u_Utils\Build\make -f Radius_S_func2.mk GENERATE_REPORT=0 INCLUDE_MDL_TERMINATE_FCN=0 COMBINE_OUTPUT_UPDATE_FCNS=1 MAT_FILE=0 MULTI_INSTANCE_CODE=0 INTEGER_CODE=0 PORTABLE_WORDSIZES=0 GENERATE_ERT_S_FUNCTION=0 GENERATE_ASAP2=0 EXT_MODE=0 EXTMODE_STATIC_ALLOC=0 EXTMODE_STATIC_ALLOC_SIZE=1000000 EXTMODE_TRANSPORT=0 TMW_EXTMODE_TESTING=0 MODELLIB=Radius_S_func2lib.lib RELATIVE_PATH_TO_ANCHOR=.. MODELREF_TARGET_TYPE=NONE OPTS="-DRT -DUSE_RTMODEL -DERT" The system cannot find the path specified.
PLease guide me how to understand the error, so i can take care of it myself.
Thank you!!
Solution: The build target was not specified therefore matlab gave the above mentioned error. To resolve this one should specify the build environment for a specific target.