Reset default gradle and plugin for android studio to be up to date when creating new projects?

两盒软妹~` 提交于 2019-12-29 07:06:07

问题


Is there a way to reset the default gradle and plugin, without resetting all my settings, so I don't keep having these errors when creating new projects?

Error: Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to

So in the top level build.gradle I update to:

dependencies {
    classpath 'com.android.tools.build:gradle:2.0.0-alpha6'

}

And then change the gradle to 2.10 as per requirements here.

2.0.0-alpha5 (2016/1/14) // hence alpha6 Needs gradle 2.10 to work


回答1:


Android Studio Template Files located on below path:

{android_studio_installation_path}\plugins\android\lib\templates\

Now for editing every type of Android Studio Template Project you must edit respective file

For Example: (edit android studio new project template)
we must edit below files:

{above_path}\gradle-projects\NewAndroidModule\root\build.gradle.ftl

In this file you must add dependencies that you want to add in every project that you create it, inside the block of dependencies

dependencies {}

Hope my description has been helpful




回答2:


I think you need to follow below step to use Default gradle wrapper(recommended):

Android studio -> Settings -> build tools -> gradle -> Project-level settings -> select Use default gradle wrapper(recommended).

And sync gradle and rebuild your project.

See Below image to get more idea:

It's work for me. I hope its helps you.



来源:https://stackoverflow.com/questions/34984905/reset-default-gradle-and-plugin-for-android-studio-to-be-up-to-date-when-creatin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!