Search code examples
androidflutterplugins

Flutter not found when developing plugin for Android


I forked a plugin with the intent to make an update to use the embedding v2 for Android. But when I opened the android folder on Android Studio it does not find Flutter. It fails to import these classes:

import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.MethodChannel.Result;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.PluginRegistry.Registrar;

Is there anything I am missing to edit the Android part of a Flutter plugin?

This is the plugin I am trying to update: https://github.com/lslv1243/launch_review

Thanks in advance!


Solution

  • It worked for me when I did the next steps (assuming that Dart and Flutter plugins are configured in the Android Studio Preferences properly):

    1. Close all the projects up until you see the "welcome to Android Studio" window with recent projects list and a set of options in the center
    2. Select "Open existing Android Studio project"
    3. Select the file plugin/example/android/build.gradle