Error: /AndroidManifest.xml not found or not a file; it should point to your project's AndroidManifest.xml

1,245 views
Skip to first unread message

niftynei

unread,
Sep 18, 2012, 9:50:08 AM9/18/12
to robol...@googlegroups.com
I'm having trouble getting the robolectric tests to run.  I followed the instructions here to set up a sample project: http://pivotal.github.com/robolectric/eclipse-quick-start.html

Everything compiles correctly, but I'm getting the following runtime error.  Did I miss a step in setup?

java.lang.RuntimeException: java.io.FileNotFoundException: ....../workspace/WifiBeeTest/./AndroidManifest.xml not found or not a file; it should point to your project's AndroidManifest.xml
at com.xtremelabs.robolectric.RobolectricTestRunner.createResourceLoader(RobolectricTestRunner.java:505)
at com.xtremelabs.robolectric.RobolectricTestRunner.setupApplicationState(RobolectricTestRunner.java:357)
at com.xtremelabs.robolectric.RobolectricTestRunner.internalBeforeTest(RobolectricTestRunner.java:307)
at com.xtremelabs.robolectric.RobolectricTestRunner.methodBlock(RobolectricTestRunner.java:285)
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.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)
Caused by: java.io.FileNotFoundException: .../workspace/WifiBeeTest/./AndroidManifest.xml not found or not a file; it should point to your project's AndroidManifest.xml
at com.xtremelabs.robolectric.RobolectricConfig.validate(RobolectricConfig.java:70)
at com.xtremelabs.robolectric.RobolectricTestRunner.createResourceLoader(RobolectricTestRunner.java:498)
... 18 more

niftynei

unread,
Sep 18, 2012, 9:58:21 AM9/18/12
to robol...@googlegroups.com
I found the answer on StackOverflow.   I'm posting a link to it here in case anyone checks this forum first (as I did).  I had set this up correctly, but was running a different Run Config.  

Here's the SO solution: 

... make sure that Eclipse is configured to set the current working directory to the root of the main project, not the test project, so it will find AndroidManifest.xml and the res directory.

Just a comment to anyone like me who had to hunt around for right place to set the working Directory. It's located in the Run Configuration setting, on the Arguments tab under the heading "Working directory" –
Reply all
Reply to author
Forward
0 new messages