I am trying to create flutter plugin, but unfortunately I have some problems. When I run flutter run
command, I see output:
Couldn't read file LocalFile: 'E:\Workspace\vision-plugin\android\src\main\kotlin\com\example\VisionPlugin.kt' even though it exists. Please verify that this file has read permission and try again.
I think the main problem is how is organized my android
directory. My plugin class exists under:
E:\Workspace\vision-plugin\android\app\src\main\kotlin\com\example\VisionPlugin.kt
instead of
E:\Workspace\vision-plugin\android\src\main\kotlin\com\example\VisionPlugin.kt
(there is an extra app
directory, which is my gradle module). I was wondering if there is a way to make flutter to read from direcory which includes app
directory.
In my pubspec.yaml
, I have defined:
flutter:
plugin:
androidPackage: com.example
pluginClass: VisionPlugin
Does anyone faced this issue and knows how to solve it?
I have to keep app
directory, as its gradle module. I've introduced modules, because I needed to add third-party .aar file, which is later used in my plugin
So my project has a structure:
vision_plugin
|_android
|_app
|_src
|_build.gradle
|_some-library
|_some-library.aar
|_build.gradle
|_buid.gradle
|_settings.gradle
|_ios
|_example
|_lib
|_test
|_pubspec.yaml