How to enable automatic download of missing Android SDK packages in Gradle

前端 未结 2 458
攒了一身酷
攒了一身酷 2021-02-04 14:25

During Google I/O 2016\'s What\'s new in Android development tools a great new feature was quickly mentioned: Android Gradle plugin can now automatically download missing depend

相关标签:
2条回答
  • 2021-02-04 15:06

    I did:

    gradle --refresh-dependencies
    

    on the terminal, and it solved the problem.

    0 讨论(0)
  • 2021-02-04 15:09

    In gradle.properties file in your project's root folder add the following line:

    android.builder.sdkDownload=true
    

    Note: at the time of writing this option is experimental. It looks like so far it downloads missing build tools and platforms, but doesn't attempt to update repositories where the support libraries or Google Play Services libraries live according to a bug report/feature request.

    Edit: since now support libraries and other libraries from Google live on maven.google.com and not in local repositories, the note above isn't as important.

    0 讨论(0)
提交回复
热议问题