abner / flutter_js

A Javascript engine to use with flutter. It uses quickjs on Android and JavascriptCore on IOS
MIT License
457 stars 108 forks source link

Cannot find dart.ffi #71

Open sunilguptasg opened 2 years ago

sunilguptasg commented 2 years ago

Merely adding import 'package:flutter_js/flutter_js.dart';

results in a long list of errors starting with : Error: Not found: 'dart:ffi' ../…/lib/javascript_runtime.dart:3 import 'dart:ffi';

even including ffi: ^1.1.2 in pubspec.yaml does not help.

abner commented 2 years ago

which Flutter/Dart version are you trying to use?

alexaung commented 2 years ago

Same thing happening for me.

Flutter (Channel stable, 3.0.1, on macOS 12.4 21F79 darwin-x64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.67.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability
shilangyu commented 1 year ago

On what platform are you trying to run your app?

fighter777 commented 1 year ago

Hello, same problem here ^^

this is a fresh install of android studio with the latest stable version 3.3.9 of flutter

I am trying to compile on the web

Flutter 3.3.9 • channel stable • https://github.com/flutter/flutter.git Framework • revision b8f7f1f986 (2 weeks ago) • 2022-11-23 06:43:51 +0900 Engine • revision 8f2221fbef Tools • Dart 2.18.5 • DevTools 2.15.0

thx you !! :)

sunilguptasg commented 1 year ago

It's been a year since I first reported the issue. Do not remember what I did other than stop using flutter_js.dart...

fighter777 commented 1 year ago

It's been a year since I first reported the issue. Do not remember what I did other than stop using flutter_js.dart...

what did you use to replace flutter_js?

shilangyu commented 1 year ago

Could you post some reproduction steps?

fighter777 commented 1 year ago

I compiled to a web version with the example https://github.com/abner/flutter_js/tree/master/example/lib

I think the problem comes from the example which is planned for a mobile version.

"import 'dart:io'; " is not supported by a web build

by the way, there is an error in the example because there is no flutter_js_example package ^^

import 'package:flutter/material.dart'; import 'package:flutter_js/flutter_js.dart'; --> import 'package:flutter_js_example/ajv_example.dart';

sunilguptasg commented 1 year ago

I do not remember - but I do now use this:

https://pub.dev/packages/universal_io