It's the right approach.

What's breaking it right now is that our plugin only works with a very
limited set of versions of Gradle. This is something we'll be much more
careful after 1.0 where:

- The gradle plugin will work with 2.2.1+. If there's a new features that
requires a new version we'll try to handle this dynamically (though I don't
expect this to happen a lot)
- Studio will load any 1.0+ version of the plugin. We've spent quite a bit
of time tweaking the model exchanged between Gradle and Studio so we're
happy now. Of course things will change and get added but Studio will
dynamically handle older version.
You could get in a situation where loading a project using Gradle 1.5
requires Studio 1.5 but this really shouldn't happen often if at all
(hopefully).

On Tue, Nov 25, 2014 at 2:44 PM, Traun Leyden <[email protected]>
wrote:

>
> I have a project which has a build.gradle file checked in, and is pointed
> to a hardcoded gradle plugin version
> <https://github.com/couchbaselabs/ToDoLite-Android/blob/master/build.gradle#L8>
> .
>
> Additionally, it is using the gradle wrapper, and that is pointed to a 
> hardcoded
> distributionUrl for gradle
> <https://github.com/couchbaselabs/ToDoLite-Android/blob/master/gradle/wrapper/gradle-wrapper.properties#L6>
> .
>
> The problem is that if these aren't kept up to date, then as new versions
> of Android Studio come out, anyone who clones and imports the project, runs
> into errors like this
> <https://groups.google.com/forum/#!topic/mobile-couchbase/YJcnRSAJRYA>:
>
> I got a dialog stating that Version 0.13.3 of the Android Gradle Plugin
> (which is what I have) requires Gradle 2.1 or newer, and offering to
> upgrade the version (in the project, I later figured out.) If I do that, I
> get a build failure:
>
> "Gradle version 1.10 is required. Current version is 2.1. If using the
> gradle wrapper, try editing the distributionUrl…"
>
>
> So is it a good idea to distribute a build.gradle with a project and tell
> people to import it, or is there a better approach?  I chose this because
> it's normally very easy for the user.
>
> If that's the recommended approach, is the only thing I can do is to make
> sure that the build.gradle and distributionUrl always match the latest
> released Android Studio?  Are there any tools / approaches that make this
> easier?  I'm maintaining multiple gradle based projects, so updating each
> one is kind of cumbersome.
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "adt-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.
http://developer.android.com | http://tools.android.com

Please do not send me questions directly. Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to