ugu11 / camera_tutorial

Apache License 2.0
36 stars 11 forks source link

Error when build #8

Closed huuthongdev closed 3 years ago

huuthongdev commented 3 years ago

I have cloned your respository and try to run it. But i met an error when build on ios/android:

../../development/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' ('../../development/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);
                                ^^^^^^^^^
../../development/flutter/.pub-cache/hosted/pub.dartlang.org/ffi-0.1.3/lib/src/utf8.dart:23:7: Error: Struct 'Utf8' is empty. Empty structs and unions are undefined behavior.
class Utf8 extends Struct {
      ^
../../development/flutter/.pub-cache/hosted/pub.dartlang.org/ffi-0.1.3/lib/src/utf16.dart:16:7: Error: Struct 'Utf16' is empty. Empty structs and unions are undefined behavior.
class Utf16 extends Struct {
      ^
../../development/flutter/.pub-cache/hosted/pub.dartlang.org/ffi-0.1.3/lib/src/allocation.dart:47:33: Error: Expected type 'T' to be a valid and instantiated subtype of 'NativeType'.
  final int totalSize = count * sizeOf<T>();
                                ^

Command PhaseScriptExecution failed with a nonzero exit code

Big thanks for your solution.

huuthongdev commented 3 years ago

I upgrade ver of ffi: ^1.0.0. It's worked.