Java.lang.IllegalStateException: There must be some overlap for resourceIdToResName

I am trying to configure robolectric for my android application. My main code has a submodule and an external library, and I do not use Maven.

After completing the steps to set up the robolectric project, when I try to run the test, it gives the following error:

java.lang.IllegalStateException: there must have been some overlap for resourceIdToResName! expected 3014 but got 3013
    at org.robolectric.res.MergedResourceIndex.merge(MergedResourceIndex.java:20)
    at org.robolectric.res.MergedResourceIndex.<init>(MergedResourceIndex.java:12)
    at org.robolectric.res.RoutingResourceLoader.<init>(RoutingResourceLoader.java:22)
    at org.robolectric.RobolectricTestRunner.createAppResourceLoader(RobolectricTestRunner.java:631)
    at org.robolectric.RobolectricTestRunner.getAppResourceLoader(RobolectricTestRunner.java:614)
    at org.robolectric.internal.ParallelUniverse.setupApplicationState(ParallelUniverse.java:35)
    at org.robolectric.RobolectricTestRunner.setupApplicationState(RobolectricTestRunner.java:414)
    at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:297)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
    at org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:241)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

Can anyone help me with this! He is trying to combine resourceIdToResName maps from two sources, what are these sources?

thank

+5
source share
1 answer

This problem is probably caused by something in your main res projects projects folder, possibly in the layout xml file.

res . res, , , , R.java.

​​ :

  <TextView android:id="@+android:id/actualValue"

  <TextView android:id="@+id/actualValue"

.

+1

All Articles