Hi all!
I am running ant tests
without making any changes to the code. And a lot of tests are failing with the same error as below. I've tried doing a fresh clone but I'm still running into the same problem.
Steps followed :
git submodule update --init
ant clean
ant MakeAuthKey
ant
ant tests
It gives the following error :
java.lang.IllegalAccessException: no such field: org.robolectric.internal.bytecode.ProxyMaker$GeneratedProxy/702529866.__proxy__/android.content.res.Configuration/putField
junit.framework.AssertionFailedError: java.lang.IllegalAccessException: no such field: org.robolectric.internal.bytecode.ProxyMaker$GeneratedProxy/702529866.__proxy__/android.content.res.Configuration/putField at org.robolectric.internal.bytecode.ProxyMaker.createProxyFactory(ProxyMaker.java:100) at org.robolectric.internal.bytecode.ProxyMaker$1.computeValue(ProxyMaker.java:45) at org.robolectric.internal.bytecode.ProxyMaker$1.computeValue(ProxyMaker.java:43) at java.lang.ClassValue.getFromHashMap(ClassValue.java:227) at java.lang.ClassValue.getFromBackup(ClassValue.java:209) at java.lang.ClassValue.get(ClassValue.java:115) at org.robolectric.internal.bytecode.ProxyMaker.createProxy(ProxyMaker.java:51) at org.robolectric.internal.bytecode.ShadowImpl.createProxy(ShadowImpl.java:34) at org.robolectric.internal.bytecode.ShadowImpl.directlyOn(ShadowImpl.java:28) at org.robolectric.shadow.api.Shadow.directlyOn(Shadow.java:46) at org.robolectric.shadows.ShadowConfiguration.setToDefaults(ShadowConfiguration.java:48) at android.content.res.Configuration.setToDefaults(Configuration.java) at android.content.res.Configuration.__constructor__(Configuration.java:426) at android.content.res.Configuration.<init>(Configuration.java) at org.robolectric.shadows.ShadowResources.getSystem(ShadowResources.java:85) at android.content.res.Resources.getSystem(Resources.java) at org.robolectric.android.internal.ParallelUniverse.setUpApplicationState(ParallelUniverse.java:80) at org.robolectric.RobolectricTestRunner.beforeTest(RobolectricTestRunner.java:290) at org.robolectric.internal.SandboxTestRunner$2.evaluate(SandboxTestRunner.java:203) at org.robolectric.internal.SandboxTestRunner.runChild(SandboxTestRunner.java:109) at org.robolectric.internal.SandboxTestRunner.runChild(SandboxTestRunner.java:36) at org.robolectric.internal.SandboxTestRunner$1.evaluate(SandboxTestRunner.java:63)Caused by: java.lang.IllegalAccessException: no such field: org.robolectric.internal.bytecode.ProxyMaker$GeneratedProxy/702529866.__proxy__/android.content.res.Configuration/putField at java.lang.invoke.MemberName.makeAccessException(MemberName.java:867) at java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1003) at java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:1377) at java.lang.invoke.MethodHandles$Lookup.findSetter(MethodHandles.java:1048) at org.robolectric.internal.bytecode.ProxyMaker.createProxyFactory(ProxyMaker.java:85) at org.robolectric.internal.bytecode.ProxyMaker$1.computeValue(ProxyMaker.java:45) at org.robolectric.internal.bytecode.ProxyMaker$1.computeValue(ProxyMaker.java:43) at java.lang.ClassValue.getFromHashMap(ClassValue.java:227) at java.lang.ClassValue.getFromBackup(ClassValue.java:209) at java.lang.ClassValue.get(ClassValue.java:115) at org.robolectric.internal.bytecode.ProxyMaker.createProxy(ProxyMaker.java:51) at org.robolectric.internal.bytecode.ShadowImpl.createProxy(ShadowImpl.java:34) at org.robolectric.internal.bytecode.ShadowImpl.directlyOn(ShadowImpl.java:28) at org.robolectric.shadow.api.Shadow.directlyOn(Shadow.java:46) at org.robolectric.shadows.ShadowConfiguration.setToDefaults(ShadowConfiguration.java:48) at android.content.res.Configuration.setToDefaults(Configuration.java) at android.content.res.Configuration.$robo$__constructor__(Configuration.java:426)Caused by: java.lang.LinkageError: loader constraint violation: when resolving field "__proxy__" the class loader (instance of <bootloader>) of the referring class, org/robolectric/internal/bytecode/ProxyMaker$GeneratedProxy, and the class loader (instance of org/robolectric/internal/bytecode/SandboxClassLoader) for the field's resolved type, android/content/res/Configuration, have different Class objects for that type at java.lang.invoke.MethodHandleNatives.resolve(Native Method) at java.lang.invoke.MemberName$Factory.resolve(MemberName.java:975) at java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1000)
How can I solve this? Thanks in advance!