Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter what does "Open for editing in Android Studio" do

Perhaps this is a dumb question, but WTH... I've created a Flutter app in Android Studio, running it in AVD devices, etc. I've reached the stage where I'm looking to sign the app, and the docs tell you to use Tools> Flutter>Open for editing in Android Studio.

What exactly is this doing? What's the difference between the first editing session, and the newly created one? The new session has many more Build menu options, including the one necessary for signing, but why aren't these present in the first editing session?

I've tried looking for any explanations for this, and drawn a blank. Always keen to learn... :-)

like image 426
user3012629 Avatar asked Feb 11 '26 10:02

user3012629


1 Answers

I had the same question for a plugin I'm developing, because in my project, when I did File -> Open -> (your project's folder)/android in Android Studio, auto-complete for Kotlin worked, but it couldn't resolve any of these references in my Kotlin plugin file:

import io.flutter.embedding.engine.plugins.FlutterPlugin
import io.flutter.embedding.engine.plugins.activity.ActivityAware
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding
import io.flutter.plugin.common.MethodChannel

so I was getting tons of:

Unresolved reference: io

enter image description here

But, if I used the 'Open for editing in Android Studio' option from the root Flutter project, the same file would appear, with all the references magically fixed. I couldn't figure out what the magic was. Then I realised a subtle difference: it had actually opened the example project, with the android plugin as a module (notice the yellow arrow pointing to the example app). So, I think this is what 'Open for editing in Android Studio': it checks to see if there is an example project where it can resolve flutter libraries. It would be nice if this was actually explained or documented somewhere though.

enter image description here

like image 193
James Allen Avatar answered Feb 14 '26 20:02

James Allen