Status Update
Comments
ra...@google.com <ra...@google.com>
ha...@vipps.no <ha...@vipps.no> #2
DESCRIBE THE ISSUE IN DETAIL:
When attempting to sync Gradle files, it fails with the error message "Collection has more than one element." (see attached idea.log for full stack trace)
If I change AGP version to 7.1.0 syncing works as expected.
STEPS TO REPRODUCE:
1. Open an existing project
2. Click "Sync project with Gradle files"
------------------
Studio Build: Chipmunk 2021.2.1 Beta 1, #AI-212.5457.46.2112.8094850
Version of Gradle Plugin: 7.3.0-alpha01
Version of Gradle: 7.3.3
Version of Java: Azul Zulu 11.0.13
OS: macOS 12.1
Chip: Apple M1 Max
Runtime version: 11.0.12+0-b1504.28-7817840 aarch64
ma...@gmail.com <ma...@gmail.com> #3
I'm seeing exactly the same stacktrace on 7.2.0-beta02
(with Gradle 7.4)
com.intellij.openapi.externalSystem.model.ExternalSystemException: Collection has more than one element.
at org.jetbrains.plugins.gradle.model.ProjectImportAction.addBuildModels(ProjectImportAction.java:346)
at org.jetbrains.plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:127)
at org.jetbrains.plugins.gradle.model.ProjectImportAction.execute(ProjectImportAction.java:42)
...
java.lang.IllegalArgumentException: Collection has more than one element.
at kotlin.collections.CollectionsKt___CollectionsKt.single(_Collections.kt:595)
at com.android.tools.idea.gradle.project.sync.ModelCacheV2ImplKt.modelCacheV2Impl$androidArtifactFrom(ModelCacheV2Impl.kt:752)
at com.android.tools.idea.gradle.project.sync.ModelCacheV2ImplKt.modelCacheV2Impl$variantFrom(ModelCacheV2Impl.kt:869)
at com.android.tools.idea.gradle.project.sync.ModelCacheV2ImplKt.access$modelCacheV2Impl$variantFrom(ModelCacheV2Impl.kt:1)
at com.android.tools.idea.gradle.project.sync.ModelCacheV2ImplKt$modelCacheV2Impl$1.variantFrom(ModelCacheV2Impl.kt:1151)
at com.android.tools.idea.gradle.project.sync.AndroidExtraModelProviderWorkerKt.createAndroidModule(AndroidExtraModelProviderWorker.kt:989)
...
je...@google.com <je...@google.com>
ka...@google.com <ka...@google.com> #4
The issue is because you are using a newer version of AGP than Android Studio! with Android Studio 2021.2.1 Beta 1, we do not recommend using any AGP version newer than AGP 7.2-beta02. xof@ I see this is because we do not restrict users from using a newer version on AGP. Any tips about this ? I am sure I saw another similar bug where we should prevent Syncing at first place, so I wanna bring this to your attention as well.
xo...@google.com <xo...@google.com> #5
I've submitted a fix for this in Dolphin Studio. I will also try to backport it to Chipmunk Studio, to try to avoid confusion from using AGP 7.4.x in Chipmunk; I'll update when that is done.
xo...@google.com <xo...@google.com> #6
I've backported and submitted the fix for Chipmunk: in future, Studio will refuse to sync with a project using an AGP from a newer series. We've also updated the compatibility table at
Description
Description has been deleted.