Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Storing version of dependency in variable in gradle

How should I store dependency version in variable in gradle build script without error from Android Studio?

When I make this:

def guavaVersion = '17.0'
compile "com.google.guava:guava:$guavaVersion"

I have:
A newer version of com.google.guava:guava than $guavaVersion is available: 17

like image 855
WojciechKo Avatar asked Jul 01 '14 23:07

WojciechKo


1 Answers

try this:

ext.guavaVersion = '17.0'
compile "com.google.guava:guava:$guavaVersion"
like image 135
Bill Lin Avatar answered Oct 24 '22 22:10

Bill Lin