Running an IntelliJ-developed plugin in Android Studio - android-studio

There's another thread about this topic here but with no accepted/sufficient answer. I am building a plugin targeted at Android Studio using IntelliJ Community Edition plugin development tools and I need to run and rebug the plugin in Android Studio. However when the run command is clicked in IntelliJ CE, it opens another instance of IntelliJ and opens the plugin in IntelliJ.
How can I change this configuration to run the plugin in Android Studio instead of IntelliJ? Upon researching, Android Studio plugins are developed using IntelliJ if I'm not mistaken (As mentioned here and here). There's no official guide addressing this. Any clarification and guides on getting this done?
EDIT
The duplicate thread does not solve the problem as it does not state a solution to run the plugin in Android Studio

Related

Do I need to install Intellij after downloading Android Studio

I am downloading Android Studio now so I can create mobile apps using Kotlin and I am totally new to it, I checked the Android Studio user guide and it says it is strongly built on IntelliJ so I am wondering do I still need to download IntelliJ or once I download Android Studio, I will find all I want in it.
Android Studio has built-in plugins with IntelliJ software. You don't need to install IntelliJ. Android Studio will work just fine.

Flutter UI Guides not showing in Android Studio

In Android Studio V4.1.3 (build no. Al-201.8743.12.41.7199119) The Flutter UI guides for widgets and methods not showing at all even though it is enabled in the settings. Please, be kind to see the screenshot =>
no Flutter UI guides
I have Flutter Plugin V55.1.1 and Dart Plugin V201.9335 installed.
All your help is highly appreciated.
Thank you
You might be creating the new Flutter project and selecting Java for Android. But when you select Kotlin and create project. The issue will be fixed.
And if you want your old projects to be converted to Kotlin, just open the terminal in that project and run this
run flutter create -a kotlin .
The dot(.) at the end is also important it will generate the Kotlin files in current directory.
After this, just re-open the project, you'll get the guides.
I have the same android studio version as you and Flutter Plugin V55.1.1 and Dart Plugin V201.9380 installed. Getting the same issue. I have even tried to enable and disable the "Show UI guidelines for build methods" in Setting > Language & Frameworks > Flutter, but nothings work.
I cloned flutter/sample from GitHub and it seem that the UI guides is showing on that samples project.
My current (kinda easy cheat) solution right now is by creating a New Flutter application project via VS Code. And when I open that flutter project on Android studio, the UI guides is there. I have configure my VS Code with the recommended setting for Dart code.
Tutorial to configure your VS Code reference: https://youtu.be/nAmOt5_fMtU?t=278
I'm pretty new in flutter development but I'm pretty sure there might be something that we can configure on Android Studio seeing that generated project file from VS Code does shows the UI guideline. If someone know how do let me know. Cheers!

How to configure an iOS Application for Kotlin Multiplatform in Android Studio?

I want to add a Run/Debug Configuration for an iOS Application for a Kotlin Multiplatform Mobile application in Android Studio 4.1.2. However, there seems to be a problem with the configuration for iOS.
In the screenshot below you can see the problem. In the dialog "Run/Debug Configuration" Android Studio complains about
Error: Please specify Xcode project location in xcodeproj property of gradle.properties
Using the "Fix" button does not solve the problem. Android Studio just adds an additional xcodeproj to gradle.properties and the complains about a duplicate parameter.
I also tried different paths (relative and absolute) for xcodeproj. No luck.
If I remember correctly, it used to work out of the box. A new Kotlin Multiplatform Mobile project was automatically configured for Android and iOS. I'm not sure what changed. Probably something was updated.
Is this a bug with the KMM plugin? Or is there something I can do on my system to fix this?
don't do that with Android Studio.
Just open Xcode, click on 'open another project...', locate to the iosApp folder that named it when creating your project on Android Studio.
after that, just click run and have fun.
If the project doesn't run right away even on opening it from Xcode and shows the shared framework is missing, Then try generating the shared framework for iOS platform using terminal. Navigate to the project folder and execute
Command: ./gradlew packForXcode
Now the shared framework should have a xcode-frameworks product and you should be able to build and run the project through Xcode.
I fixed it by downgrading the Kotlin version from 1.4.30 to 1.4.21. You can check this thread here. To downgrade, download the version you want from the plugin store and choose the install plugin from disk as in the picture below
Upgrading Android Studio version to 4.2.1, KMM plugin version to 0.2.6, creating new KMM project with KMM plugin, the problem can be fixed automatically.
If you don't wanna use Xcode:
Look like there is some IDE issues in this versions, one option would be to downgrade the Kotlin version.
What worked for me was to download the latest Canary Android Studio and setup my KMM project there.
Hopefully soon this will be stable for the next versions
Same as here: https://stackoverflow.com/a/66941077/3117650
Look like there is some IDE issues in this versions, one option would be to downgrade the Kotlin version.
What worked for me was to download the latest Canary Android Studio and setup my KMM project there.
Hopefully soon this will be stable for the next versions

Do I need to install Android Studio if I already have Intellij IDEA Ultimate?

Currently, I have IntelliJ IDEA Ultimate installed. I want to develop an Android app. Do I need to install Android Studio?
No. Android Studio is focused specifically on Android development and
provides streamlined environment and project setup, but otherwise all
of its features are available in IntelliJ IDEA.
-- JetBrains
Android Studio and IntelliJ changes for Android related functionality are kept in sync (both ways). Android Studio is free but has only a subset of functionality of IntelliJ.

How to build plugins for Android Studio?

I'm not asking about gradle plugins, I'm asking how could you change the IDE itself?, like adding a new menu.
Android Studio is based on the IntelliJ Platform, so all of the information for building IntelliJ IDEA plugins applies to Android Studio as well. See here for the IntelliJ IDEA plugin development documentation.

Resources