AndroidStudioAndRobolectric
AndroidStudioAndRobolectric copied to clipboard
Resources not found exception when applicationId is altered
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.
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