title: Cannot run gradle test tasks because of java.lang.NoClassDefFoundError: jdk/internal/reflect/GeneratedSerializationConstructorAccessor1
body: <p>I have an android project where I cannot run anymore all the test gradle tasks locally (I have 3 different flavors in this project). I have this error message 50 times before the tasks fail. I have no issue running these tasks remotely with Gitlab CI/CD, and I have another project locally where I don't have this issue neither.</p>
  <pre><code>java.lang.NoClassDefFoundError: jdk/internal/reflect/GeneratedSerializationConstructorAccessor1
      at jdk.internal.reflect.GeneratedSerializationConstructorAccessor1.newInstance(Unknown Source)
      at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
      at java.base/java.io.ObjectStreamClass.newInstance(ObjectStreamClass.java:1092)
      at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2150)
      at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1668)
      at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:482)
      at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:440)
      at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.deserializeWorker(SystemApplicationClassLoaderWorker.java:153)
      at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:121)
      at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:71)
      at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69)
      at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)
  </code></pre>