如何在gradle构建脚本中将依赖项版本存储在变量中而不会出现Android Studio的错误?
当我这样做时:
def guavaVersion = '17.0'
compile "com.google.guava:guava:$guavaVersion"
我有:
A newer version of com.google.guava:guava than $guavaVersion is available: 17
答案 0 :(得分:43)
试试这个:
ext.guavaVersion = '17.0'
compile "com.google.guava:guava:$guavaVersion"