Android: Fixes #13854: Fix missing icons where react-native-paper IconButton is used #13869
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.
In the initial release of the Joplin 3.5 mobile app, there is a regression whereby all icons are missing when implemented via the react-native-paper IconButton component. This is only an issue in the release build for Android, hence why it was not noticed until now, where the first 3.5 release was recently made for the mobile app.
The issue relates to the inclusion of getExpoDefaultConfig(__dirname) in the metro configuration (originally added in React Native 0.77 upgrade in PR #12179). I made various attempts suggested by AI and suggestions online, to override potentially problematic sections of the default expo config, however none of the suggested solutions were able to resolve the issue. However, what is clear from my testing is that the release build of Android works fine without any obvious issues when completely excluding getExpoDefaultConfig(__dirname), but it is required for the dev build to work. Therefore this PR resolves the issue by excluding this config, but only when building a release build and for the Android app specifically.
The issue is very likely related to issues various users have reported on this GitHub issue expo/expo#21568. On that report, some users have reported the missing icons issue only happening on Android, although a couple of users mentioned it happening on iOS as well. I have not tested whether or not this issue occurs on iOS release builds as well, but if it is also an issue on iOS, this change could potentially be extended to cover iOS as well in a followup PR.
This fixes #13854
Testing
Screenshots:
Before:
After: