blob: 87e0f4984adbd6c62daf7ad1fd3b026e961ec78d [file] [log] [blame] [view]
# notification_plugin
Example of Android plugin project with JNIgen.
This plugin project contains [custom code](android/src/main/java/com/example/notification_plugin) which uses the Android libraries. The bindings are generated using [JNIgen config](jnigen.yaml) and then used in [flutter example](example/lib/main.dart), with help of `package:jni` APIs.
The command to regenerate JNI bindings is:
```
flutter pub run jnigen --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 JNIgen. This is the equivalent of Gradle Sync in Android Studio, and enables JNIgen 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.