How to tell when gradle wrapper is on/off in Android Studio?

天大地大妈咪最大 提交于 2019-12-20 07:38:33

问题


I have twice now seen the message:

  Failed to apply plugin [id 'com.android.application'] Gradle version 2.1 is required. 

Current version is 2.2.1. If using the gradlewrapper, 
try editing the distributionUrl in /Users/Mac1/Downloads/u2020-dagger2 /gradle/wrapper/gradle-wrapper.properties to gradle-2.1-all.zip

Another flavor is saying you really need 2.2, again with the suggestion to hunt down the gradle-wrapper.properties file. Either way, I really need to know when the wrapper is in use or not.

Now from this message it appears that neither Studio nor Gradle are sure that a wrapper is being used. Well I am also not sure. So my question is what determines if a wrapper is used or not? And how do you set this switch? BTW, the message above is quite nonsense in Studio as it requires 2.2 in Studio 1.1 anyway. It should be suggesting an gradle upgrade in my opinion rather than suggesting this wrapper change down when there is really no reason to think that latest gradle version would not work.

Is it really reasonable to see this message everytime there is an upgrade to gradle. Should there be this kind of disconnect. That's just not logical.

PS: I am an experienced Android developer coming from an eclipse background. Yes, I'm new to Studio. I'm not new to Android, and I am not new to needing to upgrade, but before it was just switch out the sdk and that was mostly it. Now its almost always hunting down these files and syncing them. In general I like gradle/studio but I have yet to import an app off github that did not need the wrapper changed. If I cannot easily figure out if a wrapper is in use or not, something is wrong period.

At the very least, there should be a convention of saying gradle 2.1+ or above. Mins specified rather than fixing I want gradle 2.1.1 in a url. This is very ugly guys and it needs to be fixed. And if you are going to do this at least an experienced developer should be able to know immediately if an wrapper is on or off.

来源:https://stackoverflow.com/questions/29204272/how-to-tell-when-gradle-wrapper-is-on-off-in-android-studio

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