fix: building without an app.json file #627
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes builds of projects that don't have app.json file at all.
This is done by fixing two bugs:
android
andios
folders. These folders will always exist during build time rendering the checks useless. As a result bare react native projects without a valid app.json no longer fail at build time. Note that correctly configured projects are not affected by this bug at all (that's why my testing did not reveal this bug).Note that this PR fully removes the bailout conditions in both
build.gradle
andios_config.sh
. Unfortunately we have no sufficient replacement. The check used before #616 works at build time but does not work with the use case outlined in #614. Without a valid bailout condition we lose the ability to let build.gradle and ios_config.sh fail when a bare react native project does not have a valid app.json file. Instead we now show a warning during build time when no admob app ids are found in app.json or app.json does not exist at all.Related issues
Test Plan
Here is how to validate that this PR actually fixes the linked issue:
Note that I was only able to test on android this time. It would be benefitial if someone could verify these changes on ios too. To do so run the example app included in this repo on ios AND run the following commands in addition to the ones above to verify this PR works with the repro in the linked issue: