From c7c3c3f79de3601443459e63e841dcd664fdf2f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Honza=20Rychnovsk=C3=BD?= Date: Mon, 17 Jul 2023 13:49:11 +0200 Subject: [PATCH] [#903] Update doc on supported java versions --- docs/Setup.md | 3 ++- gradle.properties | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/Setup.md b/docs/Setup.md index ede042c7..b80a420b 100644 --- a/docs/Setup.md +++ b/docs/Setup.md @@ -11,7 +11,8 @@ To get set up for development, there are several steps that you need to go throu Start by making sure the command line with Gradle works first, because **all the Android Studio run configurations use Gradle internally.** The run configurations are not magic—they map directly to command line invocations with different arguments. 1. Install Java - 1. Install JVM 11 or greater on your system. Our setup has been tested with Java 11-17. Although a variety of JVM distributions are available and should work, we have settled on recommending [Adoptium/Temurin](https://adoptium.net), because this is the default distribution used by Gradle toolchains. For Windows or Linux, be sure that the `JAVA_HOME` environment variable points to the right Java version. Note: If you switch from a newer to an older JVM version, you may see an error like the following `> com.android.ide.common.signing.KeytoolException: Failed to read key AndroidDebugKey from store "~/.android/debug.keystore": Integrity check failed: java.security.NoSuchAlgorithmException: Algorithm HmacPBESHA256 not available`. A solution is to delete the debug keystore and allow it to be re-generated. + 1. Install JVM 17 or greater on your system. Our setup has been tested with Java 17. Although a variety of + JVM distributions are available and should work, we have settled on recommending [Adoptium/Temurin](https://adoptium.net), because this is the default distribution used by Gradle toolchains. For Windows or Linux, be sure that the `JAVA_HOME` environment variable points to the right Java version. Note: If you switch from a newer to an older JVM version, you may see an error like the following `> com.android.ide.common.signing.KeytoolException: Failed to read key AndroidDebugKey from store "~/.android/debug.keystore": Integrity check failed: java.security.NoSuchAlgorithmException: Algorithm HmacPBESHA256 not available`. A solution is to delete the debug keystore and allow it to be re-generated. 1. Android Studio has an embedded JVM, although running Gradle tasks from the command line requires a separate JVM to be installed. Our Gradle scripts are configured to use toolchains to automatically install the correct JVM version. 1. Install Android Studio and the Android SDK 1. Download [Android Studio](https://developer.android.com/studio/preview). As of September 2022, we recommend Android Studio Electric Eel preview because it is more robust with Kotlin Multiplatform. Also note that due to issue #420 Intel-based machines may have trouble building in Android Studio. If you experience this, the workaround is to add the following line to `~/.gradle/gradle.properties` `ZCASH_IS_DEPENDENCY_LOCKING_ENABLED=false`. diff --git a/gradle.properties b/gradle.properties index 251783f7..f277aeee 100644 --- a/gradle.properties +++ b/gradle.properties @@ -158,7 +158,7 @@ ZXING_VERSION=3.5.1 # Toolchain is the Java version used to build the application, which is separate from the -# Java version used to run the application. Android requires a minimum of 11. +# Java version used to run the application. JVM_TOOLCHAIN=17 # This shouldn't be changed, as Android doesn't support targets beyond Java 8