Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 511
Leonardo da Silva Avatar asked Jun 03 '20 12:06

Leonardo da Silva


2 Answers

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
like image 96
nyarian Avatar answered Oct 05 '22 05:10

nyarian


You should open the project in android studio from the example/android location.

like image 44
Kapandaria Avatar answered Oct 05 '22 04:10

Kapandaria