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

Add a guide on how to provide an AndroidManifest.xml when running Robolectric in a library module #101

Open
Nimrodda opened this issue Feb 3, 2022 · 0 comments

Comments

@Nimrodda
Copy link

Nimrodda commented Feb 3, 2022

I tried to use Robolectric in a library module and received an error when running the test:

Attribute data@scheme at tempFile1ProcessTestManifest273304251747743144.xml requires a placeholder substitution but no value for <someParameter> is provided.

This happened due to the library module expecting the app module to provide a value for a manifest placeholder. I realized I need to somehow provide a fake AndroidManifest.xml file to the test, but couldn't find any documentation about this. After fiddling a little with the properties file and the Config annotation to set the path to the fake AndroidManifest.xml file and failing, it crossed my mind that it's possible to provide a fake AndroidManifest.xml file to instrumentation tests (androidTest) by placing a manifest in the root of the test (/library/src/androidTest) so I tried the same with /library/src/test and finally it worked!

I think it would be really useful info to include in the user guide. I don't mind making a PR to add this. Just tell me where to place it.

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

1 participant