tree: 7379382f9fcf73dc0fd6586c8b24dca7c5c7fadc
  1. android/
  2. example/
  3. lib/
  4. src/
  5. .gitignore
  6. .metadata
  7. analysis_options.yaml
  8. jnigen.yaml
  9. pubspec.yaml
  10. README.md
pkgs/jni_gen/examples/notification_plugin/README.md

notification_plugin

Example of android plugin project with jni_gen.

This plugin project contains custom code which uses the Android libraries. The bindings are generated using jnigen config and then used in flutter example, with help of package:jni APIs.

The command to regenerate JNI bindings is:

flutter run jni_gen --config jnigen.yaml # run from notification_plugin project root 

The example/ app must be built at least once in release mode (eg flutter build apk) before running jni_gen. This is the equivalent of Gradle Sync in Android Studio, and enables jni_gen to run a Gradle stub and determine release build's classpath, which contains the paths to relevant dependencies. Therefore a build must have been run after cleaning build directories, or updating Java dependencies. This is a known complexity of the Gradle build system, and if you know a solution, please contribute to issue discussion at #33.