-
Notifications
You must be signed in to change notification settings - Fork 50
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
Support standalone target without requiring Flutter SDK #645
Comments
The packaging issue will be solved by: When the packaging issue is solved, can we suffice with a Dart-only implementation? Or are we hooking into some Flutter specific things in Java/Kotlin code for some registering the JVM on startup? |
(replying from email really messes up markup)
Yes. We have to load the native library from Assuming the
This has the tradeoff of enabling standalone SDK, but projects targetting android need to add both dependencies. |
This is a good idea, however it's not a priority for now. The number one use case of |
Note from discussion with @HosseinYousefi: We also have Java code in |
Native assets are still in experimental. Moving this backlog. |
Status Quo:
Flutter SDK is needed even if we are using
dart
command only - due to the waypackage:jni
is packaged.In theory it is possible to comment out flutter-specific parts and use the same module from standalone and flutter targets. But due to problems with
pub
, we are not able to do it. pub#3563.There are 2 parts where we need the flutter features.
JniPlugin.Java
, android only.ffiPlugin: true
directive, all flutter targets.Proposed Design:
There should be 2 packages,
package:jni
andpackage:flutter_jni_interface
The latter doesn't need to be touched by user code, apart from being included in pubspec. Latter being a flutter-specific plugin, it handles initializing android JNI behind the scenes, or packaging the DLL.
Open questions:
ffiPlugin
expects native code atsrc/
.flutter_jni_interface
be nested inpackage:jni
? This will change latter's native source path toflutter_jni_interface/src
. But only our setup scripts need to be changed to accommodate this.Disadvantages:
cc: @dcharkes
The text was updated successfully, but these errors were encountered: