NullPointerException at ShadowResources.java:55 when upgrading from 1.0-RC1 to 1.0

78 views
Skip to first unread message

Michael Burton

unread,
Dec 10, 2011, 2:50:43 PM12/10/11
to robol...@googlegroups.com
It appears that resourceLoader is null.  Did not have this problem with 1.0-RC1

java.lang.NullPointerException
        at com.xtremelabs.robolectric.shadows.ShadowResources.getIdentifier(ShadowResources.java:55)
        at android.content.res.Resources.getIdentifier(Resources.java)
        at roboguice.RoboGuice.setBaseApplicationInjector(RoboGuice.java:104)
        at roboguice.RoboGuice.getBaseApplicationInjector(RoboGuice.java:57)
        at roboguice.RoboGuice.getInjector(RoboGuice.java:130)
        at roboguice.application.ApplicationInjectionTest$AppA.onCreate(ApplicationInjectionTest.java:53)
        at roboguice.application.ApplicationInjectionTest.shouldBeAbleToInjectIntoApplication(ApplicationInjectionTest.java:27)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
        at com.xtremelabs.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:269)
        at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
        at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:115)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
        at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
        at $Proxy0.invoke(Unknown Source)
        at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
        at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:


Can be reproduced by doing "hg clone https://code.google.com/p/roboguice", upgrading the pom to use 1.0 instead of 1.0-RC1, and doing a "mvn clean install"

Michael Burton

unread,
Dec 19, 2011, 7:16:47 PM12/19/11
to robol...@googlegroups.com
Thoughts?  This was introduced in 1.0 after 1.0-RC1
Reply all
Reply to author
Forward
0 new messages