简体   繁体   中英

Can we change gradle plugin version in Android studio

My Android studio is 1.5.1 and I found 1.3.0 and 1.5.0 in

/Applications/Android Studio.app/Contents/gradle/m2repository/com/android/tools/build/gradle

But I'd like to user gradle plugin 1.1.0, I changed the gradle version in build.gradle. But it is userless, so how can I change the gradle plugin version?

The standard way is to go to "File/Project Structure":

在此处输入图片说明

and then to set your plugin configuration in the "Project" section of the window that opens:

在此处输入图片说明

(You can also directly modify your gradle files).

Each project (but you can force each module) can use a different version .

You can define the plugin inside the build.gradle file in the project (root level, or inside the module).

For example:

  classpath 'com.android.tools.build:gradle:1.3.1'
  classpath 'com.android.tools.build:gradle:1.5.0'

Otherwise you can use the menu in:

File -> Project Structure -> Project.

It will edit automatically the same build.gradle file.

**Easy way

Just Open Gradle -> wrapper and change vercion to 5.5.1 and delete gradle -wrapper.jar and run Your Project


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