简体   繁体   中英

How to update Gradle file in android studio

Is there an easy way to get gradle to update dependencies to their latest available version ?

update android-sdk ?

update android -studio too ?

For support library (com.android.support) dependencies, Android studio highlights the one that are not up to date and let you increase to the latest version with just a click. However, you need to have "Android support repository" and "Android support Library" up to date. Go to gradle file and check if is highlighted than update is available.

To download the Support Library through the SDK Manager:

  1. Start the Android SDK Manager.
  2. In the SDK Manager window, scroll to the end of the Packages list, find the Extras folder and, if necessary, expand to show its contents.
  3. Select the Android Support Library item.

Check this Android developer documentation

Note: If you're developing with Android Studio, select and install the Android Support Repository item instead.

Click the Install packages. button.

For studio :

  1. On the top menu,

select Help -> Check for Update.

  1. Upon the updates dialog, select Updates link to configure your IDE settings.

For sdk :

By default, Android Studio does not check for Android SDK updates

  1. Choose File > Settings > Appearance & Behavior > System Settings > Updates.

  2. Check the Automatically check updates for Android SDK checkbox and select an update channel.

  3. Click OK or Apply to enable the update checking.

Please check document on android developer site to update SDK

When you update Android Studio, you may receive a prompt to automatically update Gradle to the latest available version. You can choose to accept the update or manually specify a version based on your project's build requirements.

You can specify the Gradle version in either the File > Project Structure > Project menu in Android Studio, or by editing the Gradle distribution reference in the gradle/wrapper/gradle-wrapper.properties file. The following example sets the Gradle version to 2.10 in the gradle-wrapper.properties file.

distributionUrl = https://services.gradle.org/distributions/gradle-2.10-all.zip

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM