在gradle中添加依赖的任何限制

Vis*_*tel 5 dependencies android android-studio

我刚从Android Studio最近 1 个月开始。使用 gradle 可以很好地工作和提供更多功能。

但我有一个问题。

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile 'com.android.support:cardview-v7:22.0.0'
    compile 'com.android.support:design:22.2.0'
    compile 'com.android.support:recyclerview-v7:+'
    compile 'com.google.android.gms:play-services:+'


    compile files('libs/gcm.jar')
}
Run Code Online (Sandbox Code Playgroud)

App gradle我们逐一添加依赖项。所以我的问题是在build.gradle文件中添加依赖项是否有任何限制?

我们最多可以添加多少。如果我们添加很多依赖,那么它会抛出错误

Conversion to Dalvik format failed:
Unable to execute dex: method ID not in [0, 0xffff]: 65536
Run Code Online (Sandbox Code Playgroud)

提前帮助将是appriciated !

Rav*_*avi 1

build.gradle 我们可以添加任意数量的依赖项,没有这样的限制。

限制是使用超过 65K 的方法构建应用程序。参考链接