Skip to content

fix(android-sdk): add -dontwarn consumer rules for optional social SDKs - #259

Merged
xiaoyijun merged 2 commits into
v2.xfrom
xiaoyijun-fix-r8-social-dontwarn
Jun 11, 2026
Merged

fix(android-sdk): add -dontwarn consumer rules for optional social SDKs#259
xiaoyijun merged 2 commits into
v2.xfrom
xiaoyijun-fix-r8-social-dontwarn

Conversation

@xiaoyijun

Copy link
Copy Markdown
Collaborator

Summary

Fixes #255.

The v2 SDK ships built-in Alipay/WeChat social sessions whose SDKs are compileOnly dependencies. Apps that don't bundle those SDKs fail release builds under R8 full mode (the default since AGP 8) with hard missing-class errors:

Missing class com.alipay.sdk.app.OpenAuthTask (referenced from: ...AlipaySocialSession...)
Missing class com.tencent.mm.opensdk.openapi.IWXAPI (referenced from: ...WechatSocialSession...)

This adds -dontwarn com.alipay.sdk.** and -dontwarn com.tencent.mm.opensdk.** to the consumer ProGuard rules shipped with the AAR (via the existing consumerProguardFile), so consuming apps no longer need to maintain the -dontwarn workaround themselves. The two patterns cover everything the SDK references from the optional dependencies (com.alipay.sdk.app.OpenAuthTask and the com.tencent.mm.opensdk.{constants,modelbase,modelmsg,openapi} classes).

v3 (master) is unaffected — the built-in social connectors were removed there in #249.

Testing

N/A — consumer ProGuard rules only; the referenced class patterns were verified against the SDK's imports.

Checklist

  • .changeset (N/A — this repo uses release-please)
  • unit tests (N/A)
  • integration tests (N/A)
  • necessary KDoc comments (N/A)

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Android SDK’s consumer ProGuard/R8 rules to prevent R8 full-mode release builds from failing when consuming apps do not bundle the optional Alipay/WeChat SDK dependencies (which are compileOnly in the SDK).

Changes:

  • Add consumer -dontwarn rules for com.alipay.sdk.** and com.tencent.mm.opensdk.**.
  • Document why these rules are required for consumers building with R8 full mode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@xiaoyijun
xiaoyijun merged commit e4c9660 into v2.x Jun 11, 2026
3 checks passed
@xiaoyijun
xiaoyijun deleted the xiaoyijun-fix-r8-social-dontwarn branch June 11, 2026 10:53
@silverhand-bot silverhand-bot mentioned this pull request Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants