nenick / AndroidStudioAndRobolectric

Minimal Robolectric and Android Studio example
139 stars 29 forks source link

Resources not found exception when applicationId is altered #21

Open apolatynski opened 9 years ago

apolatynski commented 9 years ago

Running Robolectric tests fail with a android.content.res.Resources$NotFoundException when in build.gradle the applicationId is changed.

The exception happens when applicationId is set in defaultConfig or a build flavor to a value different than the one in the AndroidManifest. Same thing happens when applicationIdSuffix is used.

nenick commented 9 years ago

Just changing the applicationId should not give any erros but use different applicationIds is a known issue. Try the posted workaround https://github.com/robolectric/robolectric/issues/1623#issuecomment-101538263