Skip to content

[Bug]: New projects fail to build with Android Studio 2025.2.3 #8314

@bdoms

Description

@bdoms

Capacitor Version

💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 8.0.1
@capacitor/core: 8.0.1
@capacitor/android: 8.0.1
@capacitor/ios: 8.0.1

Installed Dependencies:

@capacitor/android: 8.0.1
@capacitor/core: 8.0.1
@capacitor/ios: 8.0.1
@capacitor/cli: 8.0.1

[success] Android looking great! 👌

Other API Details

npm --version: 11.6.2
node --version: v25.3.0

Platforms Affected

  • iOS
  • Android
  • Web

Current Behavior

Assuming you have a SPA you want to convert to an Android app with a fresh install of Android Studio 2025.2.3 (released January 15th, 2026) on Ubuntu using Capacitor 8.0.1:

npx cap init
npx cap add android
npx cap sync

Open Android Studio.

Run suggested upgrade steps, namely "Upgrade AGP dependency from 8.13.0 to 9.0.0".

Attempt to build the project. It fails with this error:

Build file 'android/app/build.gradle' line: 22

A problem occurred evaluating project ':app'.
> `getDefaultProguardFile('proguard-android.txt')` is no longer supported since it includes `-dontoptimize`, which prevents R8 from performing many optimizations. Instead use `getDefaultProguardFile('proguard-android-optimize.txt)`, and if needed, temporarily use `-dontoptimize` in a custom keep rule file while fixing breakages.

Expected Behavior

I expect it to build without failing.

Project Reproduction

Existing projects may or may not have this issue. But taking any project that doesn't have Capacitor yet and adding it always fails for me.

Additional Information

A workaround is to listen to the error and change the line in android/app/build.gradle to be:

proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions