Skip to content
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

Compatibility with ffi #76485

Closed
narumi147 opened this issue Feb 21, 2021 · 3 comments
Closed

Compatibility with ffi #76485

narumi147 opened this issue Feb 21, 2021 · 3 comments

Comments

@narumi147
Copy link

  1. for ffi 0.1.3, current master/dev branch will build failed, is was warning before, and now it is error.
  • Error: Struct 'XXXX' is empty. Empty structs are undefined behavior.
  • Error: Expected type 'T' to be a valid and instantiated subtype of 'NativeType'.
  1. for ffi 1.0.0, free and allocate functions are moved into abstract class, so current packages using ffi 0.1.3will also built failed.

We need to stay at a specific version if want to use those packages.

Is there any solution to make the packages compatible with old ffi and latest fluter?
Or which is is latest version of master/dev branch of flutter support old ffi?

@dcharkes
Copy link
Contributor

dcharkes commented Feb 22, 2021

Is there any solution to make the packages compatible with old ffi and latest fluter?

No, Flutter master/dev, has deprecated some dart:ffi features. See breaking changes dart-lang/sdk#44621 and dart-lang/sdk#44622. package:ffi was using these deprecated features and that is why allocate got removed from it.

Or which is is latest version of master/dev branch of flutter support old ffi?

The last stable release supports the old API.

The last beta release, and up coming stable release support the old and new API. You can use package:ffi 0.3.1-nullsafety.0 to ease the migration, it still supports the old API but also contains the new one. See the above linked breaking changes for how to migrate.

@narumi147
Copy link
Author

Thanks a lot! I didn't notice that there is such a version of 0.3.x.

@github-actions
Copy link

github-actions bot commented Aug 5, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants