I'm trying to write a Flutter plugin that relies on a third-party library on Android.
The dependency has a build.gradle
file, I've got the source and I can build an aar
file from the command line using gradle build
.
I tried to add the dependency using Android Studio but it ended up in the my_plugin/example/android
directory and no matter how many times did I try to move it to the plugin's my_plugin/android
directory, I always failed.
The reason why this is an issue is that even though the example app can be built and run, I cannot use the plugin in other Flutter apps (which is the whole reason one would create a Flutter plugin).
How do I need to add a local library module (source code) or the aar
(that I can build any time) to the Flutter plugin's Android implementation?