无法下载任何Android库的源代码

时间:2019-05-30 19:28:44

标签: android gradle

我正在尝试使用“下载源代码”按钮下载任何Android库的源代码,但是每次发生gradle任务错误。有什么办法可以解决?

10:19:06 PM: Executing task ':app:DownloadSources --stacktrace'...

Executing tasks: [:app:DownloadSources]


FAILURE: Build failed with an exception.

* What went wrong:
Task 'DownloadSources' not found in project ':app'.

* Try:
Run gradle tasks to get a list of available tasks. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.execution.TaskSelectionException: Task 'DownloadSources' not found in project ':app'.


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

BUILD FAILED in 0s
10:19:06 PM: Task execution finished ':app:DownloadSources --stacktrace'.

1 个答案:

答案 0 :(得分:0)

好吧,我找到了答案:我正在使用android.support库,该库已被AndroidX取代。 您需要将项目迁移到AndroidX或使用低于28的API