Task build-convention fails on Android Studio Chipmunk
HonzaR opened this issue · comments
Describe the issue
Once I've updated to Android Studio Chipmunk, our build-convention
is failing while building the app.
My current AS version:
Android Studio Chipmunk | 2021.2.1
Build #AI-212.5712.43.2112.8512546, built on April 28, 2022
Runtime version: 11.0.12+0-b1504.28-7817840 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 11.6.5
GC: G1 Young Generation, G1 Old Generation
Memory: 3072M
Cores: 8
Registry: external.system.auto.import.disabled=true
Non-Bundled Plugins: org.toml.lang (0.2.155.4114-212), Statistic (4.1.10), com.godwin.json.parser (1.6), idea.plugin.protoeditor (212.5080.8), org.rust.lang (0.4.164.4409-212), org.intellij.plugins.markdown (212.5457.16), com.thoughtworks.gauge (212.4746.52), org.jetbrains.kotlin (212-1.6.21-release-334-AS5457.46), com.developerphil.adbidea (1.6.5)
Actual behavior + errors
It's failing in build-convention
with this output:
Executing tasks: [:assemble, :testClasses] in project /Users/honza/Projects/secant-android-wallet/build-convention
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'build-convention'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:{strictly 1.4.31}.
Required by:
project :
> Cannot find a version of 'org.jetbrains.kotlin:kotlin-stdlib-jdk8' that satisfies the version constraints:
Dependency path ':build-convention:unspecified' --> 'org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:2.1.7' (runtime) --> 'org.gradle.kotlin:gradle-kotlin-dsl-plugins:2.1.7' (runtimeElements) --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31'
Constraint path ':build-convention:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:{strictly 1.4.31}' because of the following reason: Pinned to the embedded Kotlin
Constraint path ':build-convention:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:{strictly 1.5.31}' because of the following reason: dependency was locked to version '1.5.31'
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:{strictly 1.5.31}.
Required by:
project :
> Cannot find a version of 'org.jetbrains.kotlin:kotlin-stdlib-jdk8' that satisfies the version constraints:
Dependency path ':build-convention:unspecified' --> 'org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:2.1.7' (runtime) --> 'org.gradle.kotlin:gradle-kotlin-dsl-plugins:2.1.7' (runtimeElements) --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31'
Constraint path ':build-convention:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:{strictly 1.4.31}' because of the following reason: Pinned to the embedded Kotlin
Constraint path ':build-convention:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:{strictly 1.5.31}' because of the following reason: dependency was locked to version '1.5.31'
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib:{strictly 1.4.31}.
Required by:
project :
> Cannot find a version of 'org.jetbrains.kotlin:kotlin-stdlib' that satisfies the version constraints:
Dependency path ':build-convention:unspecified' --> 'org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:2.1.7' (runtime) --> 'org.gradle.kotlin:gradle-kotlin-dsl-plugins:2.1.7' (runtimeElements) --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31' (runtime) --> 'org.jetbrains.kotlin:kotlin-stdlib:1.5.31'
Constraint path ':build-convention:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib:{strictly 1.4.31}' because of the following reason: Pinned to the embedded Kotlin
Constraint path ':build-convention:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib:{strictly 1.5.31}' because of the following reason: dependency was locked to version '1.5.31'
Dependency path ':build-convention:unspecified' --> 'org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:2.1.7' (runtime) --> 'org.gradle.kotlin:gradle-kotlin-dsl-plugins:2.1.7' (runtimeElements) --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31' (runtime) --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.31' (runtime) --> 'org.jetbrains.kotlin:kotlin-stdlib:1.5.31'
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib:{strictly 1.5.31}.
Required by:
project :
> Cannot find a version of 'org.jetbrains.kotlin:kotlin-stdlib' that satisfies the version constraints:
Dependency path ':build-convention:unspecified' --> 'org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:2.1.7' (runtime) --> 'org.gradle.kotlin:gradle-kotlin-dsl-plugins:2.1.7' (runtimeElements) --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31' (runtime) --> 'org.jetbrains.kotlin:kotlin-stdlib:1.5.31'
Constraint path ':build-convention:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib:{strictly 1.4.31}' because of the following reason: Pinned to the embedded Kotlin
Constraint path ':build-convention:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib:{strictly 1.5.31}' because of the following reason: dependency was locked to version '1.5.31'
Dependency path ':build-convention:unspecified' --> 'org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:2.1.7' (runtime) --> 'org.gradle.kotlin:gradle-kotlin-dsl-plugins:2.1.7' (runtimeElements) --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31' (runtime) --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.31' (runtime) --> 'org.jetbrains.kotlin:kotlin-stdlib:1.5.31'
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk7:{strictly 1.4.31}.
Required by:
project :
> Cannot find a version of 'org.jetbrains.kotlin:kotlin-stdlib-jdk7' that satisfies the version constraints:
Dependency path ':build-convention:unspecified' --> 'org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:2.1.7' (runtime) --> 'org.gradle.kotlin:gradle-kotlin-dsl-plugins:2.1.7' (runtimeElements) --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31' (runtime) --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.31'
Constraint path ':build-convention:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:{strictly 1.4.31}' because of the following reason: Pinned to the embedded Kotlin
Constraint path ':build-convention:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:{strictly 1.5.31}' because of the following reason: dependency was locked to version '1.5.31'
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk7:{strictly 1.5.31}.
Required by:
project :
> Cannot find a version of 'org.jetbrains.kotlin:kotlin-stdlib-jdk7' that satisfies the version constraints:
Dependency path ':build-convention:unspecified' --> 'org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:2.1.7' (runtime) --> 'org.gradle.kotlin:gradle-kotlin-dsl-plugins:2.1.7' (runtimeElements) --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31' (runtime) --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.31'
Constraint path ':build-convention:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:{strictly 1.4.31}' because of the following reason: Pinned to the embedded Kotlin
Constraint path ':build-convention:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:{strictly 1.5.31}' because of the following reason: dependency was locked to version '1.5.31'
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-common:{strictly 1.4.31}.
Required by:
project :
> Cannot find a version of 'org.jetbrains.kotlin:kotlin-stdlib-common' that satisfies the version constraints:
Dependency path ':build-convention:unspecified' --> 'org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:2.1.7' (runtime) --> 'org.gradle.kotlin:gradle-kotlin-dsl-plugins:2.1.7' (runtimeElements) --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31' (runtime) --> 'org.jetbrains.kotlin:kotlin-stdlib:1.5.31' (runtime) --> 'org.jetbrains.kotlin:kotlin-stdlib-common:1.5.31'
Constraint path ':build-convention:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-common:{strictly 1.4.31}' because of the following reason: Pinned to the embedded Kotlin
Constraint path ':build-convention:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-common:{strictly 1.5.31}' because of the following reason: dependency was locked to version '1.5.31'
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-common:{strictly 1.5.31}.
Required by:
project :
> Cannot find a version of 'org.jetbrains.kotlin:kotlin-stdlib-common' that satisfies the version constraints:
Dependency path ':build-convention:unspecified' --> 'org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:2.1.7' (runtime) --> 'org.gradle.kotlin:gradle-kotlin-dsl-plugins:2.1.7' (runtimeElements) --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31' (runtime) --> 'org.jetbrains.kotlin:kotlin-stdlib:1.5.31' (runtime) --> 'org.jetbrains.kotlin:kotlin-stdlib-common:1.5.31'
Constraint path ':build-convention:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-common:{strictly 1.4.31}' because of the following reason: Pinned to the embedded Kotlin
Constraint path ':build-convention:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-common:{strictly 1.5.31}' because of the following reason: dependency was locked to version '1.5.31'
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31.
Required by:
project : > org.gradle.kotlin:gradle-kotlin-dsl-plugins:2.1.7
> Cannot find a version of 'org.jetbrains.kotlin:kotlin-stdlib-jdk8' that satisfies the version constraints:
Dependency path ':build-convention:unspecified' --> 'org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:2.1.7' (runtime) --> 'org.gradle.kotlin:gradle-kotlin-dsl-plugins:2.1.7' (runtimeElements) --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31'
Constraint path ':build-convention:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:{strictly 1.4.31}' because of the following reason: Pinned to the embedded Kotlin
Constraint path ':build-convention:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:{strictly 1.5.31}' because of the following reason: dependency was locked to version '1.5.31'
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib:1.5.31.
Required by:
project : > org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31
project : > org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.31
> Cannot find a version of 'org.jetbrains.kotlin:kotlin-stdlib' that satisfies the version constraints:
Dependency path ':build-convention:unspecified' --> 'org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:2.1.7' (runtime) --> 'org.gradle.kotlin:gradle-kotlin-dsl-plugins:2.1.7' (runtimeElements) --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31' (runtime) --> 'org.jetbrains.kotlin:kotlin-stdlib:1.5.31'
Constraint path ':build-convention:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib:{strictly 1.4.31}' because of the following reason: Pinned to the embedded Kotlin
Constraint path ':build-convention:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib:{strictly 1.5.31}' because of the following reason: dependency was locked to version '1.5.31'
Dependency path ':build-convention:unspecified' --> 'org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:2.1.7' (runtime) --> 'org.gradle.kotlin:gradle-kotlin-dsl-plugins:2.1.7' (runtimeElements) --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31' (runtime) --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.31' (runtime) --> 'org.jetbrains.kotlin:kotlin-stdlib:1.5.31'
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.31.
Required by:
project : > org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31
> Cannot find a version of 'org.jetbrains.kotlin:kotlin-stdlib-jdk7' that satisfies the version constraints:
Dependency path ':build-convention:unspecified' --> 'org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:2.1.7' (runtime) --> 'org.gradle.kotlin:gradle-kotlin-dsl-plugins:2.1.7' (runtimeElements) --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31' (runtime) --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.31'
Constraint path ':build-convention:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:{strictly 1.4.31}' because of the following reason: Pinned to the embedded Kotlin
Constraint path ':build-convention:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:{strictly 1.5.31}' because of the following reason: dependency was locked to version '1.5.31'
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-common:1.5.31.
Required by:
project : > org.jetbrains.kotlin:kotlin-stdlib:1.5.31
> Cannot find a version of 'org.jetbrains.kotlin:kotlin-stdlib-common' that satisfies the version constraints:
Dependency path ':build-convention:unspecified' --> 'org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:2.1.7' (runtime) --> 'org.gradle.kotlin:gradle-kotlin-dsl-plugins:2.1.7' (runtimeElements) --> 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31' (runtime) --> 'org.jetbrains.kotlin:kotlin-stdlib:1.5.31' (runtime) --> 'org.jetbrains.kotlin:kotlin-stdlib-common:1.5.31'
Constraint path ':build-convention:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-common:{strictly 1.4.31}' because of the following reason: Pinned to the embedded Kotlin
Constraint path ':build-convention:unspecified' --> 'org.jetbrains.kotlin:kotlin-stdlib-common:{strictly 1.5.31}' because of the following reason: dependency was locked to version '1.5.31'
@HonzaR Do you want to see if you run those tasks (:assemble, :testClasses) with the --write-locks flag? You might also want to try --rerun-tasks at the same time.
I'm guessing that something is cached in Android Studio or Gradle somewhere, causing it to fail. The --write-locks lets us see if there's a dependency lock that's wrong. And --rerun-tasks helps if some cached task needs to be re-run.
I've already tried to invalidate caches and restart the IDE, clean and re-build the project, nothing helped. Fortunately, it lets me run the app, so we're not blocked on it for now. Running the commands, as suggested above doesn't show anything suspicious, output:
./gradlew assembleDebug --write-locks --rerun-tasks
Type-safe project accessors is an incubating feature.
Persisted dependency lock state for project ':'
Persisted dependency lock state for buildscript of project ':'
> Task :app:stripZcashmainnetDebugDebugSymbols
Unable to strip the following libraries, packaging them as they are: libzcashwalletsdk.so.
> Task :app:stripZcashtestnetDebugDebugSymbols
Unable to strip the following libraries, packaging them as they are: libzcashwalletsdk.so.
Persisted dependency lock state for buildscript of project ':'
Persisted dependency lock state for project ':'
Persisted dependency lock state for buildscript of project ':'
Persisted dependency lock state for buildscript of project ':app'
Persisted dependency lock state for project ':app'
Persisted dependency lock state for project ':build-info-lib'
Persisted dependency lock state for project ':preference-api-lib'
Persisted dependency lock state for project ':preference-impl-android-lib'
Persisted dependency lock state for project ':sdk-ext-lib'
Persisted dependency lock state for project ':sdk-ext-ui-lib'
Persisted dependency lock state for project ':spackle-lib'
Persisted dependency lock state for project ':test-lib'
Persisted dependency lock state for project ':ui-design-lib'
Persisted dependency lock state for project ':ui-lib'
BUILD SUCCESSFUL in 47s
Here is an update on this:
- Our build setup works well on Apple Silicon Mac.
- Intel Mac machines appeared to be problematic and our
build-convention
module failed to build with the output above. - Intel Windows behaves the same as Intel Mac.
- Building the project from command-line works well.
- Building it from Stable channel Android Studio
Chipmunk | 2021.2.1 Patch 1 will fail
. - Building it from Preview channel Android Studio
Dolphin (2021.3.1) Beta 1
orElectric Eel (2022.1.1) Canary 2
is alright.
Additionally:
- It’s happening also on previous versions of AGP, we currently use 7.2.1, but it’s also tested with 7.2.0 and 7.1.3.
- It’s happening during the build of the project, not during the sync.
- And it's happening on our other projects too - SDK and ECC-Wallet - which all use dependency locking too.
We've filed the issue to Google's Issue Tracker.