This message was deleted.
# community-support
s
This message was deleted.
v
Copy code
com/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
This means you compiled
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.
Copy code
Caused by: org.gradle.api.UnknownDomainObjectException: Extension of type 'JavaToolchainService' does not exist. Currently registered extension types: [ExtraPropertiesExtension, TestDistributionExtension, PredictiveTestSelectionExtension, TestRetryExtension, KoverTaskExtension]
This means you try to get the
JavaToolchainService
from the
Test
task, but it is an extension on the
Project
, so it is of course not found.
m
ah ha, ok cool. So now my errors are the same for both methods. the
UnsupportedClassVersionError
thank you @Vampire
so i've set
Copy code
compileOptions {
  sourceCompatibility = JavaVersion.VERSION_11
  targetCompatibility = JavaVersion.VERSION_11
}
which gets me further. paparazzi throws a further error
Copy code
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 @Vampire
v
I wouldn't use
*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.
m
hey @Vampire, ok so this may have looped back to being a sort of gradle issue. https://github.com/cashapp/paparazzi/issues/1031#issuecomment-1691078391
in that the paparrazi gradle task is not picking up the
os.arch
correctly.
re-installing the IDE seems like a weird step here
v
I'm not really following.
os.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.
m
i'm trying the same but just using
gradlew
I thought using
--no-build-cache
might have helped
v
What does
./gradlew --version
say, can you provide a build
--scan
?
m
Copy code
mshearer@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
lemmie see if i can remember how to dump a build scan
sorry, no idea. is it
dump
in the url or something?
v
Dumping will not help, I'm not a Gradle employee, so I couldn't do anything with a dump. And if it is on the public build scan service, there is no dump available anyway. But it's ok, the OS line already shows that you execute Gradle with a JDK that returns
aarch64
for
os.arch
.
Or did you not mean what you said with "paparrazi gradle task", so not something running in the Gradle process? I have no idea what paparazzi is
m
it's a testing framework which runs as a gradle task
i'm seeing if i remove all gradle cache etc might help, as the arch does seem to be read correctly when i run any task
v
You could start with
--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.
Except of course if it additionally stores state somewhere like some folder in the user home or whatever, so if that did not work, to be super sure, you should test on some virgin system, like some docker container where definitely no state is present anywhere.
m
cool, trying now
thanks for the help @Vampire. In the end it worked after deleting all jdks installed on the machine. And installing only an mac arm jdk
👌 1