Get List of Android Product Flavours to use in Android Studio Plugin Follow
Answered
I am building a plugin for Android Studio that needs to know all the product flavours of the Android project that is currently open. Unfortunately, I am clueless how to get them into the Java plugin and I am not sure if this is even the correct place to ask. Can anyone offer any advice if this is even possible? Thank you.
Please sign in to leave a comment.
com.android.tools.idea.gradle.project.model.AndroidModuleModel contains a number of "Flavor" methods (make sure to add dependency to Android plugin http://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_dependencies.html)
Yann, thank you! I wish I knew about this sooner - the Android plugin has so many things that I've been looking for.
I do however have a quick question. I am importing the plugin in the below way
When I compile my own plugin into a jar and add it to Android Studio, I get the below error when I try to use any of the Android methods or classes.
I understand that this may be because I do not have the Android plugin in Android Studio, but if it isn't one of the plugins from the screenshot below, then which plugin is it? I know this isn't an Android Studio support page, so I highly appreciate any help.
Did you add <depends> tag to your plugin.xml? http://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_dependencies.html
I can't find the ID of the plugin (to be honest I can't even find it online). I have the :android: jar in my Gradle Dependencies, but don't see it in my Libraries, so can't go and check the ID. Do you know it?
"org.jetbrains.android" you should have autocompletion as well
That works! Thank you, Yann!!