Slackbot
08/01/2023, 11:17 AMVampire
08/01/2023, 12:18 PMThis means you compiledCopy codecom/hubspot/android/marketing/social/BaseSocialTest$Logger has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
BaseSocialTest
with target Java 17 but try to use it somewhere where Java 11 is used and Java 11 cannot read a Java 17 class file.
This means you try to get theCopy codeCaused by: org.gradle.api.UnknownDomainObjectException: Extension of type 'JavaToolchainService' does not exist. Currently registered extension types: [ExtraPropertiesExtension, TestDistributionExtension, PredictiveTestSelectionExtension, TestRetryExtension, KoverTaskExtension]
JavaToolchainService
from the Test
task, but it is an extension on the Project
, so it is of course not found.Matthew Shearer
08/01/2023, 12:34 PMUnsupportedClassVersionError
Matthew Shearer
08/01/2023, 12:34 PMMatthew Shearer
08/01/2023, 12:56 PMcompileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
which gets me further.
paparazzi throws a further error
kotlin.UninitializedPropertyAccessException: lateinit property sessionParamsBuilder has not been initialized
at app.cash.paparazzi.Paparazzi$Companion.getSessionParamsBuilder$paparazzi(Paparazzi.kt:626)
at app.cash.paparazzi.Paparazzi.prepare(Paparazzi.kt:162)
at app.cash.paparazzi.Paparazzi$apply$statement$1.evaluate(Paparazzi.kt:124)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
but i guess that's them, thanks again @VampireVampire
08/01/2023, 1:05 PM*Compatibility
but indeed also there set the toolchain.
If setting the compatibility values solves the problem, then setting the toolchain to 11 for the same project should also work and be the better choice.
The UninitializedPropertyAccessException
indeed does not seem to be Gradle related, but a code problem.Matthew Shearer
08/24/2023, 8:18 AMMatthew Shearer
08/24/2023, 8:19 AMos.arch
correctly.Matthew Shearer
08/24/2023, 8:19 AMVampire
08/24/2023, 8:59 AMos.arch
is a Java system property. When running an x86_64
Java on an aarch64
system through some emulation layer, then your OS is the emulated x86_64
of course. I have no idea what reinstalling AS changed, but I would guess that rahnamaMo
did change the project or module SDK in his tries to fix it, but not the JDK that is used to run Gradle which is a separate setting in the "Gradle" settings of the IDE. I would guess that with uninstalling and reinstalling AS the Gradle JDK setting was also changed, or it is set to use the AS built-in JDK and before it was an x86_64
version of AS and the reinstalled is an aarch64
one. Just setting the Gradle JDK to a proper one in the Gradle settings of AS would probably have fixed the issue as far as I understood it.Matthew Shearer
08/24/2023, 9:06 AMgradlew
Matthew Shearer
08/24/2023, 9:06 AM--no-build-cache
might have helpedVampire
08/24/2023, 9:08 AM./gradlew --version
say, can you provide a build --scan
?Matthew Shearer
08/24/2023, 9:10 AMmshearer@D62TT4D9J2 HubSpotOneAndroid % ./gradlew --version
------------------------------------------------------------
Gradle 8.0.2
------------------------------------------------------------
Build time: 2023-03-03 16:41:37 UTC
Revision: 7d6581558e226a580d91d399f7dfb9e3095c2b1d
Kotlin: 1.8.10
Groovy: 3.0.13
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 17.0.8 (Eclipse Adoptium 17.0.8+7)
OS: Mac OS X 13.5 aarch64
Matthew Shearer
08/24/2023, 9:10 AMMatthew Shearer
08/24/2023, 9:18 AMdump
in the url or something?Vampire
08/24/2023, 9:24 AMaarch64
for os.arch
.Vampire
08/24/2023, 9:30 AMMatthew Shearer
08/24/2023, 10:15 AMMatthew Shearer
08/24/2023, 10:16 AMVampire
08/24/2023, 10:18 AM--rerun-tasks
if you didn't yet.
Or if it does not help, yeah, quick test without caching all kills on all other builds too, set the GRADLE_USER_HOME
environment variable to some place and delete <root project>/.gradle
and <root project>/build
, then there should be no state that could come from anywhere.Vampire
08/24/2023, 10:19 AMMatthew Shearer
08/24/2023, 10:25 AMMatthew Shearer
08/28/2023, 12:27 PM