-
-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there any initialize version for windows? #324
Comments
@kechankrisna I think they're working on it via this PR: #162 |
The CI breaks out now, it shouldn't take much times to fixed it. I can release a beta version supporting windows this week. |
@NoahJinnn @kechankrisna I finally figure out how to build webf dll in github actions. The first initialize version for windows is 0.14.0-beta.11+2. |
I'm facing this issue while running [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Invalid argument(s): Failed to load dynamic library 'webf.dll': error code 126
#0 _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:11:43)
#1 new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:22:12)
#2 WebFDynamicLibrary.ref (package:webf/src/bridge/dynamic_library.dart:56:52)
#3 _registerPluginByteCode (package:webf/src/bridge/to_native.dart:256:24)
#4 _registerPluginByteCode (package:webf/src/bridge/to_native.dart)
#5 registerPluginByteCode (package:webf/src/bridge/to_native.dart:261:3)
#6 registerWebfWebsocketByteData (package:webf_websocket/websocket_qjsc.dart:12:3)
#7 WebFWebSocket.initialize (package:webf_websocket/webf_websocket.dart:8:5)
#8 main (package:webf_example/main.dart:12:17)
#9 _runMain.<anonymous closure> (dart:ui/hooks.dart:131:23)
#10 _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:297:19)
#11 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:192:26) Re-produce steps:
git clone git@github.com:openwebf/webf.git
git checkout beta/0.14.0
npm install
npm run build:bridge:windows
cd webf/example
flutter run
webf: ^0.14.0-beta.11+2
# dependency_overrides:
# webf:
# path: ../ Then, run The same error returned for both cases. Do you have any suggestion? @andycall |
@swqsldz can you provide your test codes so I can reproduce on my devices? |
url: https://pan.baidu.com/s/1O_EdOzfgUdvlpGY2R69-rw?pwd=7tlr |
@swqsldz Hmm, I can't access the Baidu Disk address on my laptop. Could you create a GitHub repository and upload your code there instead? |
just use the flutter create demo
webf: ^0.14.0-beta.11+2 |
@swqsldz try 0.14.0-beta.11+3 |
@NoahJinnn Here is a released Windows binary build with WebF 0.14.0-beta.11+3. It has been tested on several Windows machines. You can try it to see if there are any other configurations that could affect the running of WebF. |
@andycall I'm able to run flutter create project with dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
webf: ^0.14.0-beta.11+3 However, I still get the error logs as below: Logs
|
If these files are exist on your project's build directory? , the path is : |
Yes I have those files inside |
I'm also trying with Code:/* * Copyright (C) 2019-2022 The Kraken authors. All rights reserved. * Copyright (C) 2022-present The WebF authors. All rights reserved. */import 'package:flutter/material.dart'; void main() { class MyApp extends StatelessWidget { class MyBrowser extends StatefulWidget { // This widget is the home page of your application. It is stateful, meaning // This class is the configuration for the state. It holds the values (in this final String? title; @OverRide class _MyHomePageState extends State { @OverRide
} Output: Flutter doctor: Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.7.11, on Microsoft Windows [Version 10.0.22621.1194], locale en-US)
[✓] Windows Version (Installed version of Windows is version 10 or higher)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[✗] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Visual Studio - develop for Windows (Visual Studio Community 2022 17.5.4)
[!] Android Studio (not installed)
[✓] VS Code (version 1.77.3)
[✓] Connected device (2 available)
[✓] HTTP Host Availability
! Doctor found issues in 3 categories. |
The But you can try some ways to diagnose the problems. The error shows static DynamicLibrary? _ref;
static DynamicLibrary get ref {
DynamicLibrary? nativeDynamicLibrary = _ref;
_ref = nativeDynamicLibrary ??= DynamicLibrary.open('D:\the_absolute_path\to\webf.dll');
return nativeDynamicLibrary;
} |
@andycall I can not build
|
run |
is your laptop are running in 32 bit mode? wmic cpu get AddressWidth |
Its x64
|
@andycall Is the Windows SDK causing issues? I did check
My current Windows tools installation with Visual Studio: |
Error code 193 is due to using a 64 bit sdk and loading a 32 bit dll, or vice versa. But I checked all dlls hosted on pub.dev are all 64-bit formats. |
Maybe you can try the following module on your laptop to see if it works? It has the same loading phases as WebF on Windows. |
I did check the dynamic built from I had all the built files inside Able to run on my mac M1 but still fail on my Windows 11... Facing different error:
Regarding the My test repo: https://github.com/NoahJinnn/test-webf @andycall can you help me to check the repo? |
My logs when run Build logs> build:bridge:windows > cross-env node scripts/build_windows_dll.jsRemoving .dart_tool/
src/index.ts → dist/main.js... src/test/index.js → dist/test.js...
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.-- Use the C++ compiler to compile (MI_USE_CXX=ON)-- Library base name: mimalloc-debug
|
Looks like the build is success |
I don't think these installation can affect the loadin process of If |
Thanks for your information. I did try |
@NoahJinnn Here is a minimal example with Dart FFI: https://github.com/dart-lang/samples/tree/main/ffi/hello_world Run the following commands to build the cd .\hello_library\
cmake .
cmake --build . Then run the following commands to test this example: dart pub get
dart hello.dart If you got the "hello world" result, It proves that the main loading DLL process through Dart FFI works. Therefore, I suspect that the problems might be due to some cirtical DLL files missing in your system. If you can not run this minimal example, the only way would be ask the dart team what's going on. |
I'm able to run the example with the successful result: C:\Users\Noah\Desktop\samples\ffi\hello_world> dart hello.dart
Hello World So, I think my laptop is missing some critical |
@andycall I use "Process Monitoring" to trace the
|
@NoahJinnn I'm on a business trip and only have a macbook with me. I'll need to return home and use my Windows PC to investgate this problem over the weekend. |
Should this be an RFC?
Description
Is there any initialize version for windows? so community can help to contribute the rest part.
Alternatives and Workarounds
No response
The text was updated successfully, but these errors were encountered: