Resolve @null drawable references due to resource overlays #94
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.
This PR adds automatic resolution of
@nulldrawable references thatappear in binary XML files when merging Android App Bundles (AAB) to APK.
Disclaimer: AI assisted but properly tested by me. I can't share the apk but the code
is pretty self explanatory and you don't need to merge it until you can find another apk
with same issue. Just leaving it out there if someone bumps in same issue.
Problem:
When merging split APKs, some drawable XML files contain references
to
@null(ValueType.REFERENCE with data=0). These unresolved referencescause Resources$NotFoundException crashes at runtime when the app tries
to load these resources.
Solution:
Implementation Details
Results from testing:
Before:
<item android:drawable="@null" />After:
<item android:drawable="@drawable/abc_btn_switch_to_on_00012" />Notes: