I\'m using android studio 3.4.1 and my Kotlin version is 1.3.31
. I have a flutter app. When trying to add cloud_firestore
to my app I have the followin
I could be that your IDE has an older level of the Kotlin plugin.
Within Android Studio, got to File
> Settings...
> Kotlin
and check to make sure your plugin is up to date. You may see something like this, indicating you need to update:
Also, if you run into memory issues, you may need to add org.gradle.jvmargs=-Xms1024m -Xmx4096m
to the gradle.properties
file.
First Check your JVM version
Open Window
Go to Java from Programs
Now Update JVM version in your Android Studio
That's it. Your studio will build again automatically..
In Android Studio,
Click "Shift" button twice
Enter Kotlin Compiler as shown below
Change Target JVM version from 1.6 to 12
This works for me.
For Mac(Catalina) Users
Select Android Studio (This is hidden, move your cursor to the top of the screen to reveal this option)
Then,
Preferences -> Kotlin Compiler -> Target JVM Version
now modify the respective java version, I changed Target JVM version from 1.6 to 1.8 to make it work.
Shortcut to open Preferences in Android Studio is Cmd + ,
Faced this same error. I had to update my JVM Version in Kotlin Compiler settings.
You can find that setting here: File -> Settings -> Kotlin Compiler -> Target JVM Version
Changing to 1.8
fixed the issue.
To me, using IDEA 2019.3.4, change Kotlin JVM version to IDEA bundled one (version:11) which found in Project Settings->Platform Settings->SDKs , solved the problem.