JShell console in Android Studio - android-studio

IntelliJ IDEA 2017.1 has a built-in JShell, which imports all the project's libraries etc.
Is it possible to use this in Android Studio? (It is not in the Tools menu, as said in the blog post).
UPDATE: Android still does not support Java 8 completely, JShell is Java 9. It might still be possible to use the gradle jshell plugin, or use the Kotlin REPL.

You can also use my project jshell-plugin that is a fork of the gradle jshell plugin you mentioned, but with improved features.
Also as you mentioned, you need JDK 9+ to run it, but if it is not your default JDK and you don't want to change that configuration from your local environment, here is a trick:
$ export JAVA_HOME="/path/to/jdk9+"
$ gradle --console plain jshell
The export of the JAVA_HOME environment variable will have effect only in the active console you have opened.

Related

Plugin Error: Plugin "Visual Paradigm SDE for IntelliJ IDEA (Community Edition)" is incompatible (supported only in IntelliJ IDEA)

When I install the Visual Paradigm SDE for IntelliJ IDEA (Community Edition) plugin, it doesn't work. After installing it and closing and reopening Android Studio 4.2, I get the above error message. How do I use this plugin with Android Studio 4.2?
I solved the problem by using UML Generator instead
To answer the original question
You have to install the full version of the related product before the plugin will function properly. This can be purchased over at https://www.visual-paradigm.com (a trial period is also available).
If you prefer an alternative to this paid software and need to fully remove the plugin
Note - Uninstalling the typical way will not work with this plugin.
Trash the plugin file:
Visual_Paradigm_SDE_for_IntelliJ_IDEA_%28Community_Edition%29_1149.jar
Depending on the version of AS your plugin path may vary slightly.
Located (on MacOS):
/Users/[username]/Library/Application Support/Google/yourAndroidStudioVersion/plugins
Located (on Windows):
C:\Users\yourUserName\AppData\Roaming\Google\yourAndroidStudioVersion\plugins

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

Why daemon from Android Studio is not compatible for terminal?

If we use gradle clean build, it will create a daemon. On the other hand, if we clean or build through Android studio, it also generates another daemon.
So, How can we make daemons compatible?
Actually, there are two main reasons to be incompatible.
One is version mismatch of Gradle and Java. Gradle version may be
same but JDK versions are different.
By default, Android Studio is using embedded JDK, which most likely
has a different version from Java installed in our machine.
How can we make daemon compatible?
If we use the local java in Android Studio instead of embedded JDK, this issue will be solved.
Procedure:
In Android Studio, go to Project Structure -> SDK location.
Uncheck “Use embedded JDK” and
specify your local JDK.
Pictorial View is given below:
First Part:
Second Part:

Merge Intellij IDEs to have only one installed

This is a basic question.
I use Android Studio, AppCode, IntelliJ IDEA, PHPStorm and RubyMine.
Is there any way to merge all of those IDEs?
For example, IntelliJ IDEA with plugins for each type of development instead of having 5 IDEs that are basically the same.
Thanks.
Intellij IDEA Ultimate includes all the features available in PHPStorm and RubyMine (but you need installing some missing plugins from the repository). Same for Android Studio (https://blog.jetbrains.com/idea/2013/05/intellij-idea-and-android-studio-faq/). So you can just use Intellij IDEA for Ruby, PHP and Android development. AppCode, however, can't be replaced with IDEA

How to inactivate class in Tools window of project of Android Studio

What I want to do is to inactivate the one of java class in the tools window of project which is left sided of screen as usual. I tried to find how to inactivate it. But I could not find it. I guess it was existed in Eclipse on Windows version.
My environment:
Android Studio 0.4.0 on OSX
Do you know someone about it? Or, Could you tell me alternative way to inactivate?
Sincerely,
You can use File> Settings > Compiler >Excludes to exclude some classes or file while compilation.
I never tried Inactive in Eclipse so not sure if this do the same which Eclipse Do.

Resources