Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 14, 2025

The Android build was failing due to AAR metadata incompatibility - androidx.core:core-ktx:1.15.0 requires compileSdk 35, but AGP 8.5.2 only supports up to SDK 34. Additionally, Glance widget API calls were using internal methods that are no longer accessible.

SDK and Tooling Upgrades

  • AGP 8.5.2 → 8.7.3 to support compileSdk 35
  • compileSdk/targetSdk 34 → 35 (minSdk remains 24)
  • Java 21 now properly configured across app and Capacitor modules
  • Removed composeOptions.kotlinCompilerExtensionVersion - auto-managed by Kotlin 2.0+ Compose plugin

Glance Widget API Migration

Previous internal API calls are no longer accessible:

// Before (fails compilation)
WeatherWidget().update(context, appWidgetManager)
WeatherWidget().update(context, widgetId)

// After
val glanceManager = GlanceAppWidgetManager(context)
val glanceId = glanceManager.getGlanceIdBy(widgetId)
WeatherWidget().update(context, glanceId)

Also updated actionStartActivity<MainActivity>() to actionStartActivity(Intent(context, MainActivity::class.java)).

Resource Fixes

  • Removed duplicate splash.png (conflicts with splash.xml)
  • Added missing splashBackground color and title_activity_main string
  • Fixed Material3 theme reference: @android:style/Theme.Material3.DayNight@style/Theme.Material3.DayNight

Build Process

Capacitor sync now correctly generates capacitor-cordova-android-plugins/cordova.variables.gradle after web app build.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Problem

The Android build is still failing after adding the Compose Compiler plugin. The new error occurs in the Gradle task :app:checkDebugAarMetadata.

This error typically indicates:

  • Mismatched compileSdkVersion, minSdkVersion, or targetSdkVersion
  • Incompatible library versions with the configured SDK versions

Task

Continue debugging and fixing the entire Android build process:

  1. Fix the :app:checkDebugAarMetadata error:

    • Check rootProject.ext.compileSdkVersion, minSdkVersion, and targetSdkVersion values
    • Ensure all SDK version properties are set to valid, consistent, and compatible values
    • Update to recent stable SDK versions if needed (e.g., compileSdk 34, minSdk 24, targetSdk 34)
  2. Verify dependency compatibility:

    • Ensure all dependencies support the configured SDK versions
    • Update any outdated or incompatible dependencies
  3. Complete the full build:

    • Don't stop at the Compose configuration phase
    • Continue until assembleDebug completes successfully
    • Fix any additional errors that appear during the build process

Notes

  • The build uses rootProject.ext.* properties for SDK versions - check where these are defined (likely in root build.gradle or gradle.properties)
  • Run the full ./gradlew assembleDebug to verify the complete build works

This pull request was created as a result of the following prompt from Copilot chat.

Problem

The Android build is still failing after adding the Compose Compiler plugin. The new error occurs in the Gradle task :app:checkDebugAarMetadata.

This error typically indicates:

  • Mismatched compileSdkVersion, minSdkVersion, or targetSdkVersion
  • Incompatible library versions with the configured SDK versions

Task

Continue debugging and fixing the entire Android build process:

  1. Fix the :app:checkDebugAarMetadata error:

    • Check rootProject.ext.compileSdkVersion, minSdkVersion, and targetSdkVersion values
    • Ensure all SDK version properties are set to valid, consistent, and compatible values
    • Update to recent stable SDK versions if needed (e.g., compileSdk 34, minSdk 24, targetSdk 34)
  2. Verify dependency compatibility:

    • Ensure all dependencies support the configured SDK versions
    • Update any outdated or incompatible dependencies
  3. Complete the full build:

    • Don't stop at the Compose configuration phase
    • Continue until assembleDebug completes successfully
    • Fix any additional errors that appear during the build process

Notes

  • The build uses rootProject.ext.* properties for SDK versions - check where these are defined (likely in root build.gradle or gradle.properties)
  • Run the full ./gradlew assembleDebug to verify the complete build works

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…sage

- Upgraded AGP from 8.5.2 to 8.7.3 to support compileSdk 35
- Updated compileSdk, targetSdk to 35 (minSdk remains 24)
- Built web app and ran npx cap sync to regenerate Capacitor files
- Removed composeOptions.kotlinCompilerExtensionVersion (Kotlin 2.0+ auto-manages)
- Fixed duplicate splash resource (removed splash.png, kept splash.xml)
- Added missing color resource (splashBackground) and string (title_activity_main)
- Fixed theme reference from @android:style to @Style
- Installed and configured Java 21 for Capacitor compatibility
- Updated Glance widget API calls to use GlanceAppWidgetManager
- Fixed actionStartActivity to pass Intent parameter
- Build now completes successfully with assembleDebug

Co-authored-by: LuminLynx <212206643+LuminLynx@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Android build errors related to AAR metadata Fix Android build: upgrade to SDK 35, AGP 8.7.3, and Glance widget API Dec 14, 2025
Copilot AI requested a review from LuminLynx December 14, 2025 22:18
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.

2 participants