Android project fails to build (works fine in Android Studio) - Unsupported method: AndroidArtifact.getPrivacySandboxSdkInfo()

已回答

I'm trying to build an Android open source project (https://github.com/FossifyOrg/Calendar) in IntelliJ IDEA 2025.3.3 Ultimate / Windows 11 which builds fine in Android Studio, in IDEA however I get build errors:

Multiple build operations failed.
   Unsupported method: AndroidArtifact.getPrivacySandboxSdkInfo().
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle you connect to.
Alternatively, you can ignore this exception and read other information from the model.

What does this mean and how do I fix it?

(Note: I'm a beginner in Android development, so I need step by step instructions. :))

I tried to run Tools > Android > AGP Upgrade Assistant but it's unuseable, it's showing the spinning wheel/ Loading forever.

Thanks.

 

 



 

0

Thanks for reporting this.

This is a known issue. IntelliJ IDEA's Android plugin does not yet support the newest versions of the Android Gradle Plugin (AGP). The project you are building uses a newer AGP than IDEA 2025.3.3 officially supports, which causes the "Unsupported method: AndroidArtifact.getPrivacySandboxSdkInfo()" error. Android Studio ships with its own AGP support and updates faster, which is why it works there.

This is tracked here:

You can vote for these issues to increase their priority.

Workaround

There is a hidden flag that lets IDEA sync with unsupported AGP versions. Here is how to enable it:

  1. In IntelliJ IDEA, go to Help | Edit Custom Properties...
  2. A file will open in the editor (it may be empty). Add this line: idea.is.internal=true
  3. Save the file and restart IntelliJ IDEA.
  4. After restarting, press Ctrl+Shift+A (or Cmd+Shift+A on Mac) to open the "Find Action" dialog.
  5. Type Edit Studio Flags and select the matching action.
  6. In the flags list, find the flag called gradle.ide.support.future.agp.versions and enable it (set to true).
  7. Close the dialog and re-sync your Gradle project (File | Sync Project with Gradle Files or click the Gradle reload icon).

This should allow the project to sync and build. Note that some Android-specific IDE features may not work perfectly with an unsupported AGP version, but basic building and running should work.

Regarding the AGP Upgrade Assistant loading forever, this is likely a side effect of the same AGP incompatibility. It should not be needed after applying the workaround above.

Let us know if this helps.

1

Thanks for the detailed reply, much appreciated.

Didn't help unfortunately, I get the same error after doing your described steps.

Please see screenshots attached (this is after restarting the IDE and running “Sync project with Gradle files”).

0

Unfortunately, it means you will have to wait until the more recent tooling is merged into IntelliJ IDEA.

0

Honestly, it surprises me that IDEA Ultimate as a commercial product is behind the free Android Studio.

Anyway, thanks again for your help and I'll stick with Android Studio (for this project at least) for the time being.

0

Sorry about that. I bumped the priority of the issue and requested a fix from the developers.

1

I am using IntelliJ IDEA 2025.3.4 and encounter the same issue.
Has it been resolved / when will it be resolved?
What is the latest AGP version which is fully supported?
 

0

Hi Mictiemix,
I’m sorry that you’ve encountered this issue.

The latest supported AGP version for IntelliJ IDEA 2026.1 with the Android plugin should be 9.0.0-alpha06.
Unfortunately, we cannot provide a specific ETA for fixing this issue. Please subscribe to issue IDEA-385007 in our bug tracker to stay updated on any progress.

0

请先登录再写评论。