Skip to content

Bump SuperwallSDK.androidlib compileSdk to 35 (fixes checkReleaseAarMetadata failure)#4

Open
bilck wants to merge 1 commit into
superwall:mainfrom
bilck:fix/android-compilesdk-35
Open

Bump SuperwallSDK.androidlib compileSdk to 35 (fixes checkReleaseAarMetadata failure)#4
bilck wants to merge 1 commit into
superwall:mainfrom
bilck:fix/android-compilesdk-35

Conversation

@bilck

@bilck bilck commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Problem

SuperwallSDK.androidlib/build.gradle hardcodes compileSdkVersion 34, but its floating dependency api 'com.superwall.sdk:superwall-android:2.+' currently resolves to 2.7.21, which transitively pulls androidx.activity:activity[-ktx]:1.10.1. That artifact's AAR metadata declares minCompileSdk=35, so every Unity Android export now fails:

Execution failed for task ':unityLibrary:SuperwallSDK.androidlib:checkReleaseAarMetadata'.
> Dependency 'androidx.activity:activity-ktx:1.10.1' requires libraries and applications that
  depend on it to compile against version 35 or later of the Android APIs.
  :unityLibrary:SuperwallSDK.androidlib is currently compiled against android-34.

This started breaking builds with zero changes on the consumer side - Gradle simply re-resolved 2.+ to the new release. Reproduced on Unity 6000.4 / AGP 9.0, but it affects any consumer whose dependency cache refreshes.

Fix

One line: compileSdkVersion 34compileSdkVersion 35. Chosen as the smallest possible change:

  • compileSdk only affects compile-time API visibility - it does not change minSdk (device support) or targetSdk (runtime behavior), so no consumer-facing behavior changes.
  • Keeps the legacy compileSdkVersion DSL spelling, so no change to the AGP version range the module works on today.
  • Consumers on current 2.+ resolutions cannot build at all without this, so it can't regress anyone.

Alternatives you may prefer (happy to rework the PR)

  1. Inherit the host project's compileSdk instead of hardcoding: Unity writes the project's value into the generated gradle.properties, so compileSdk (findProperty("unity.compileSdkVersion") ?: 35) as int keeps the module permanently aligned with the app's Player Settings and avoids the next bump. (The compileSdk DSL needs AGP 7.0+, which the file's existing namespace DSL already requires.)
  2. Pin superwall-android to an exact version per Unity SDK release instead of 2.+. The floating range is the root cause here: a Maven-side release changed every consumer's build overnight. An exact pin makes Android SDK bumps deliberate and releases reproducible.

Related (separate issue, not in this PR)

Under AGP 9.0 (Unity 6.4 default), the module's buildscript + apply plugin: 'kotlin-android' wiring crashes Gradle evaluation (LibraryExtensionImpl no longer inherits from BaseExtension); AGP 9's built-in Kotlin support makes it unnecessary there, but older AGP still needs it. We currently strip it at export time with an IPostGenerateGradleAndroidProject post-processor on our side - can share that or open a follow-up issue if useful.

🤖 Generated with Claude Code

superwall-android 2.+ currently resolves to 2.7.21, which pulls in
androidx.activity 1.10.1. That artifact's AAR metadata declares
minCompileSdk=35, so every Unity Android export now fails at
:unityLibrary:SuperwallSDK.androidlib:checkReleaseAarMetadata while the
module compiles against android-34.

compileSdk only affects compile-time API visibility (not minSdk device
support or targetSdk runtime behavior), so this is safe for all consumers -
and consumers on current 2.+ resolutions cannot build without it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant