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

Fails with org.robolectric:robolectric:3.0-rc3 #22

Open
mtotschnig opened this issue May 22, 2015 · 5 comments
Open

Fails with org.robolectric:robolectric:3.0-rc3 #22

mtotschnig opened this issue May 22, 2015 · 5 comments

Comments

@mtotschnig
Copy link

When updating to the latest RC for Robolectric 3.0, the tests no longer work, but lead to the following error:

java.lang.RuntimeException: /Users/mtotschnig/entwicklung/AndroidStudioAndRobolectric/app/build/intermediates/bundles/debug/res/values is not a directory
    at org.robolectric.res.DocumentLoader.load(DocumentLoader.java:27)
    at org.robolectric.res.PackageResourceLoader.loadEverything(PackageResourceLoader.java:32)
    at org.robolectric.res.PackageResourceLoader.doInitialize(PackageResourceLoader.java:19)
    at org.robolectric.res.XResourceLoader.initialize(XResourceLoader.java:29)
    at org.robolectric.res.OverlayResourceLoader.doInitialize(OverlayResourceLoader.java:22)
    at org.robolectric.res.XResourceLoader.initialize(XResourceLoader.java:29)
    at org.robolectric.res.XResourceLoader.getValue(XResourceLoader.java:52)
    at org.robolectric.res.OverlayResourceLoader.getValue(OverlayResourceLoader.java:51)
    at org.robolectric.res.RoutingResourceLoader.getValue(RoutingResourceLoader.java:31)
    at org.robolectric.shadows.ShadowAssetManager.getAndResolve(ShadowAssetManager.java:353)
    at org.robolectric.shadows.ShadowAssetManager.getAndResolve(ShadowAssetManager.java:349)
    at org.robolectric.shadows.ShadowAssetManager.getResourceText(ShadowAssetManager.java:67)
    at android.content.res.AssetManager.getResourceText(AssetManager.java)
    at android.content.res.Resources.getText(Resources.java:270)
    at org.robolectric.shadows.ShadowResources.getText(ShadowResources.java:358)
    at android.content.res.Resources.getText(Resources.java)
    at android.content.res.Resources.getString(Resources.java:360)
    at org.robolectric.shadows.ShadowContext.getString(ShadowContext.java:33)
    at org.robolectric.shadows.ShadowContextWrapper.getString(ShadowContextWrapper.java:78)
    at android.content.Context.getString(Context.java)
    at org.robolectric.util.ActivityController.getActivityTitle(ActivityController.java:108)
    at org.robolectric.util.ActivityController.attach(ActivityController.java:49)
    at org.robolectric.util.ActivityController$1.run(ActivityController.java:121)
    at org.robolectric.shadows.ShadowLooper.runPaused(ShadowLooper.java:305)
    at org.robolectric.shadows.CoreShadowsAdapter$2.runPaused(CoreShadowsAdapter.java:45)
    at org.robolectric.util.ActivityController.create(ActivityController.java:118)
    at org.robolectric.util.ActivityController.create(ActivityController.java:129)
    at org.robolectric.util.ActivityController.setup(ActivityController.java:210)
    at org.robolectric.Robolectric.setupActivity(Robolectric.java:46)
    at com.example.myapplication.RobolectricTest.testIt(RobolectricTest.java:16)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:245)
    at org.robolectric.RobolectricTestRunner.runChild(RobolectricTestRunner.java:185)
    at org.robolectric.RobolectricTestRunner.runChild(RobolectricTestRunner.java:54)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:149)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
´´´
@mtotschnig
Copy link
Author

I forgot to mention that this problem is limited to running the test in Android Studio (on MacOS). It works fine when running with Gradle from the command line.

@nenick
Copy link
Owner

nenick commented May 25, 2015

As a fast workaround read Note for Mac User at http://robolectric.org/getting-started/

I will take a look why my workaround does not work anymore.

@nenick
Copy link
Owner

nenick commented May 25, 2015

Now it should work again

@nilsi
Copy link

nilsi commented Jun 5, 2015

I have this problem to. (on Mac)
Already have $MODULE_DIR$ at Defaults -> JUnit -> Working directory
Im using: org.robolectric:robolectric:3.0-rc3
Any ideas?

@nenick
Copy link
Owner

nenick commented Jun 12, 2015

@nilsi What are your steps to get this error? You shouldn't get this if you use the master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants