Tuesday, 5 November 2013

Do you android.content.res.Resources$NotFoundException: unknown resource ? (aka Testing with Robolectric (II))

I assumed that one only needed to specify the location of the manifest if, like here, you were extending the Application class. After reading and failing miserably to get the most stupid test up and running, turns out that when you have BuildTypes and/or Flavours you have to explicit about your manifest too.

So if you are getting one of these pesky exceptions:
android.content.res.Resources$NotFoundException: unknown resource XXXXXX
Double check that you specify the location of your AndroidManifest file in the @Config anotation.

1 comment :

  1. So how do I set the manifest= ??? when my manifest file is in a separate project in eclipse... Not sure of the syntax it should be.

    ReplyDelete