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... :-)
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

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.

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With