audiooffler/JucyFluttering

Trying to run flutter

kjartanvalur opened this issue · 3 comments

Hi, I´m trying to run the /fluttering app. I first got the following error. I´m using flutter version 2.2.0, dart 2.13.0


c:/src/flutter/.pub-cache/hosted/pub.dartlang.org/ffi-0.1.3/lib/src/utf8.dart:63:33: Error: The getter 'addressOf' isn't defined for the class 'Utf8'.
 - 'Utf8' is from 'package:ffi/src/utf8.dart' ('/c:/src/flutter/.pub-cache/hosted/pub.dartlang.org/ffi-0.1.3/lib/src/utf8.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'addressOf'.
  String toString() => fromUtf8(addressOf);

But after updating to ffi 1.0.0 I get this error:

lib/jucy_fluttering_interop.dart:54:30: Error: Method not found: 'Utf8.fromUtf8'. String resultString = Utf8.fromUtf8(utf8Ptr); ^^^^^^^^ lib/jucy_fluttering_interop.dart:55:3: Error: Method not found: 'free'. free(utf8Ptr); ^^^^

Good Point. With FFI 1.0 there are some breaking changes, so now malloc.free() has to be used on the pointer. As soon I can find some free time I'll try to make some updates to be compatible with the current Flutter/Dart API and FFI again.

changed the fromUtf8AndFree function as shown below and now it runs but it is unable to load Juce framework.
DynamicLibrary.open('libjuce_jni.so') returns null. Am I missing something? cannot find this libjuce_jni.so file. Should I download something?


String fromUtf8AndFree(Pointer<Utf8> utf8Ptr) {
  String resultString = utf8Ptr.toDartString();
  calloc.free(utf8Ptr);
  return resultString;
}