Android Studio Download Sources Failed

523 Views Asked by At

enter image description here

I want to view the source code of androidx.compose, but when I click download sources, I will get error:

Executing tasks: [:module_widget:DownloadSources] in project /Users/venshine/Work/Zenepic/Botverse/build/mobile/BotVerse-Android/module_widget

Configuration on demand is an incubating feature.
> Task :module_widget:DownloadSources FAILED

FAILURE: Build failed with an exception.

* Where:
Initialization script '/private/var/folders/g5/5v5pjm192qjd3wwjf0zybh_r0000gn/T/ijmiscinit5.gradle' line: 25

* What went wrong:
Execution failed for task ':module_widget:DownloadSources'.
> Could not resolve all files for configuration ':module_widget:downloadSources_334b2bfe-8c44-4bff-8d12-bca3a5b29b08'.
   > Could not find androidx.compose.foundation:foundation-layout:1.4.2@aar.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/androidx/compose/foundation/foundation-layout/1.4.2@aar/[email protected]
       - https://repo.maven.apache.org/maven2/androidx/compose/foundation/foundation-layout/1.4.2@aar/[email protected]
     Required by:
         project :module_widget

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 897ms
1 actionable task: 1 executed

settings.gradle

pluginManagement {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
    }
}

I run normally on a Mac Intel chip computer, but when the same code is switched to a Mac Apple chip, the situation above occurs. What should I do?

1

There are 1 best solutions below

1
On

I've encountered the same issue,the way to remove the dependency on Compose BOM