I want to add native android library in my flutter project, I am trying to perform platform channelling but Flutter Activity is not getting imported in my android code, I founded out that it may be because of this as this is showing as a problem, I have tried updating the flutter plugin, restarting ide but nothing is working. What can I do that flutter for android can get imported? Flutter Activity not getting imported Thank you.
2 Answers
I also got errors opening Android-specific code in my Flutter project. If the Flutter app compiles and run without issues, then you should be fine. For full Android Studio support on your Android code, you can click 'Open for Editing in Android Studio' displayed on the active tab. This should help check for any errors or warnings in your Android code. You can check this documentation for more details regarding editing Android code in Flutter projects on Android Studio.
There's also an experimental feature that supports Android code checks in a Flutter project. To try it out, you can enable this feature in the Preferences by ticking the Enable code completion, navigation, etc. for Java / Kotlin
checkbox. You can check this GitHub ticket for more details.

- 8,564
- 2
- 42
- 144
you can go to file project structure and follow is img.. [1]: https://i.stack.imgur.com/mhHj4.png
Run the command gradlew clean and, then run gradlew build