[Fix] "could not be instantiated" exception when; some modules are omitted AND android.enableR8.fullMode=true #2136
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
One Line Summary
Fix "could not be instantiated" exception when; some modules are omitted AND
android.enableR8.fullMode
is enabled.Details
This also fixes the stack traces reported when attempting to use a module that wasn't included 2b2e76a
Motivation
This results in crashes when these two conditions are meet. SDK should include all Proguard rules so app developers don't have to manually add them to avoid issues like this.
Scope
Only effects keeping a bit more code when minification is enabled.
Testing
Manual testing
Tested with the included example app with the following modifications:
android.enableR8.fullMode=true
toExamples/OneSignalDemo/gradle.properties
com.onesignal:OneSignal:5.1.15
withcom.onesignal:core:5.1.15
inExamples/OneSignalDemo/app/buidle.gradle
Reproduced the crash reported in issue #1969 and ensured it no longer happens after the change. Tested on an Android 6.0 emulator.
Affected code checklist
Checklist
Overview
Testing
- CI doesn't currently build or run the demo app.
Final pass
This change is