-
Notifications
You must be signed in to change notification settings - Fork 7
Plugin crashes on Android Studio 4.1 #19
Comments
Oh no. We upgraded the plugin build to use JDK 11, because JetBrains Platform now runs on Java 11 by default. It seems your Android Studio is configured to use Java 1.8. I see that Android Studio 4.0.1 uses JetBrains Platform 2017.1.2 which runs on Java 1.8 and is fairly old. I'm surprised Android Studio allows the plugin to be installed at all, because the minimum supported platform version is 2020.1. Downgrading the project to build with JDK 1.8 would be unfortunate but not that hard. I'm more worried about having to downgrade the platform all the way to 2017.1.2. I don't want to leave Android Studio users out of luck though. Let me look into the best way to handle this. |
I just installed the latest Android Studio then I installed the Dark Mode Sync plugin. If you open Android Studio's Troubleshooting Info window, you'll see that it is using Java 1.8 and it installs an old version of the plugin since the latest version is not yet supported by Android Studio's underlying platform.
I'm going to close this issue out, but I will consider changing the plugin so that it is compatible with the old versions of JetBrains Platform that Android Studio uses. As a former Android developer, it makes me sad that it doesn't work on Android Studio. |
Hi! It looks like a slight misunderstanding; I filed this against Android Studio 4.1 (now at beta 5), not 4.0.1. The plugin is actually working fine for me on 4.0.1, because the plugin installer automatically keep Dark Mode Sync on version 1.1.0 for compatibility. But version 4.1 (beta 5) is updated to a much newer version of IntelliJ I believe, so it allows updating Dark Mode Sync to 1.2.2, and then crashes as described previously.
I notice that it still uses the same 1.8.0 runtime, so this is probably still the root of the problem. |
You may be able to workaround the issue by changing Android Studio's runtime to use a Java 11 runtime - see https://www.jetbrains.com/help/idea/switching-boot-jdk.html. I would like to figure out if Android Studio 4.1 Beta 5 is expected to run on Java 1.8. IntelliJ removed support for a Java 1.8 runtime in version 2020.1. Based on that information, I thought it was safe to upgrade this project to target Java 11. I don't see anything in the release notes for Android Studio 4.1 beta that would indicate which version of IntelliJ platform it uses. |
I see now that I'm going to reopen this issue. I might need to downgrade the build to use Java 1.8 again if there are 201 builds using Java 1.8 out there. Let me chat with JetBrains a bit and figure this out |
I have some clarity from the JetBrains team
So while IntelliJ distributes with JBR11, Android Studio still distributes with JBR8. I will downgrade the plugin build to target Java 1.8 |
IntelliJ Platform 2020.1 is distributed with JBR11, but it is still compatible with JBR8, so the plugin needs to target Java 1.8
Fixed in 1.2.4 |
The good news is that 1.2.5 works on Android Studio 4.2 Canary 8, which I understand is the first AS version to ship with Java 11. So when that goes stable around maybe the end of the year (total guess on my part) you can safely go back to Java 11. The bad news is that 1.2.5 I still gives almost the same stacktrace as be 8000 fore on Android Studio 4.1 RC 1. Though the offending class name is different. Is it possible that some part of this is still compiled with Java 11?
|
You're right - some classes are still targeting Java 11. I downloaded version 1.2.5 from the JetBrains plugin repository and found that there's a mix of Java 1.8 and Java 11 classes
It looks like the Java classes are using 1.8, but the Kotlin classes are targeting Java 11. It looks like I missed a configuration in the Gradle build 🤦♂️ |
Fixed in 1.2.6 |
If I enable this plugin on Android Studio 4.1 beta 1, the plugin crashes immediately when the IDE is opened. Here's the stack:
It works fine on Android Studio 4.0.
The text was updated successfully, but these errors were encountered: