Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.IllegalAccessError: class com.android.resources.ResourceType tried to access method 'java.util.stream.Collector #1257

Closed
alextfos opened this issue Jan 24, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@alextfos
Copy link

Description
We can't set up Paparazzi at our project. We are experiencing an exception when we tried to execute tests and execute the command app:recordPaparazziDebug. I 've seen the problem others developers experienced, but we haven't imported guava nor Truth.

Steps to Reproduce
Run tests or launch recordPaparazziDebug command.

Expected behavior
The app works normally when running tests and generating images when recordPaparazziDebug command is launched.

Additional information:

  • Paparazzi Version: 1.3.2
  • OS: Mac OS Sonoma 14.2.1
  • Compile SDK: 34
  • Gradle Version: 8.0
  • Android Gradle Plugin Version: 8.1.0

Screenshots
java.lang.IllegalAccessError: class com.android.resources.ResourceType tried to access method 'java.util.stream.Collector com.google.common.collect.Sets.toImmutableEnumSet()' (com.android.resources.ResourceType and com.google.common.collect.Sets are in unnamed module of loader 'app') at com.android.resources.ResourceType.<clinit>(ResourceType.java:175) at app.cash.paparazzi.internal.DynamicResourceIdManager$IdProvider.<init>(DynamicResourceIdManager.kt:14) at app.cash.paparazzi.internal.DynamicResourceIdManager.<init>(DynamicResourceIdManager.kt:28) at app.cash.paparazzi.internal.PaparazziCallback.<init>(PaparazziCallback.kt:52) at app.cash.paparazzi.Paparazzi.prepare(Paparazzi.kt:155) at app.cash.paparazzi.Paparazzi$apply$1.evaluate(Paparazzi.kt:142) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63) at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) at org.junit.runners.ParentRunner.run(ParentRunner.java:413) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:108) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:40) at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:60) at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:52) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36) at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33) at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94) at jdk.proxy2/jdk.proxy2.$Proxy5.processTestClass(Unknown Source) at org.gradle.api.internal.tasks.testing.worker.TestWorker$2.run(TestWorker.java:176) at org.gradle.api.internal.tasks.testing.worker.TestWorker.executeAndMaintainThreadName(TestWorker.java:129) at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:100) at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:60) at org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:56) at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:113) at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:65) at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69) at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)

@alextfos alextfos added the bug Something isn't working label Jan 24, 2024
@jrodbx
Copy link
Collaborator

jrodbx commented Jan 24, 2024

but we haven't imported guava nor Truth.

You haven't directly, but Paparazzi is, so you'll still get this error:

java.lang.IllegalAccessError: class com.android.resources.ResourceType tried to access method 'java.util.stream.Collector com.google.common.collect.Sets.toImmutableEnumSet()' 

and will have to apply the guava fix in the 1.3.2 release notes. Sorry for the inconvenience, but feel free to weigh in on google/guava#6801 which is the current tracking issue of record for this.

@jrodbx jrodbx closed this as completed Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants