fix: R8 AutoValue suppressions + Huawei release in CI#2592
fix: R8 AutoValue suppressions + Huawei release in CI#2592abdulraqeeb33 merged 1 commit intomainfrom
Conversation
- Add consumer ProGuard rules for com.google.auto.value.* so minified apps do not fail on missing OTel transitive references. - Align demo proguard with AutoValue + Builder suppressions. - Extend CI demo build to run :app:assembleHuaweiRelease alongside GMS. Made-with: Cursor
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent R8 minified-release failures caused by missing optional transitive classes referenced by OpenTelemetry (notably AutoValue), and to ensure the demo app’s Huawei minified release is built in CI.
Changes:
- Add
-dontwarnsuppressions forcom.google.auto.value.AutoValue*in the OTel module consumer ProGuard rules. - Align the demo app ProGuard rules with the same AutoValue suppressions.
- Update CI to attempt building both GMS and Huawei minified release variants for the demo app.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
examples/demo/app/proguard-rules.pro |
Adds AutoValue -dontwarn lines for demo minified builds. |
OneSignalSDK/onesignal/otel/consumer-rules.pro |
Adds AutoValue -dontwarn lines to avoid R8 missing-class errors for SDK consumers. |
.github/workflows/ci.yml |
Updates CI to include Huawei release assembly in the demo minified build job. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: "[Build] Demo app (minified GMS + Huawei release)" | ||
| working-directory: OneSignalSDK | ||
| run: | | ||
| ./gradlew :app:assembleGmsRelease --console=plain | ||
| ./gradlew :app:assembleGmsRelease :app:assembleHuaweiRelease --console=plain |
There was a problem hiding this comment.
The demo app conditionally applies either com.google.gms.google-services or com.huawei.agconnect based on gradle.startParameter.taskRequests (it uses an if (...) { } else if (...) { }), so invoking :app:assembleGmsRelease and :app:assembleHuaweiRelease in the same Gradle run will only apply the first-matched plugin (likely google-services). That can cause the Huawei release build to be built without the intended Huawei plugin/config, or fail depending on the build. Consider running these as two separate Gradle invocations (or separate steps), so each build config is exercised with the correct plugin applied.
📊 Diff Coverage Report✓ Coverage check passed (no source files changed) |
Summary
-dontwarnforcom.google.auto.value.AutoValue,AutoValue$Builder, andAutoValue$CopyAnnotationsso R8 no longer fails on missing Auto Value types referenced by OpenTelemetry / disk buffering (e.g. Huawei minified release).examples/demowith the same Auto Value suppressions (plus existing Jackson lines).:app:assembleHuaweiReleasealongside:app:assembleGmsReleasein the existing demo minified-release step (fromOneSignalSDKcomposite:app).Verification
./gradlew :app:assembleGmsRelease :app:assembleHuaweiReleasefromOneSignalSDKsucceeded.Made with Cursor