任何限制在 gradle 中添加依赖项
Any restriction To add dependency in gradle
我最近 1 个月才开始 Android Studio
。 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')
}
在App gradle
中,我们一一添加依赖。
所以我的问题是在 build.gradle
文件中添加依赖项是否有任何限制?
我们最多可以添加多少。如果我们添加很多依赖项,那么它会抛出错误
Conversion to Dalvik format failed:
Unable to execute dex: method ID not in [0, 0xffff]: 65536
提前帮助将不胜感激!!
不,没有限制,但你必须注意这些事情。
http://developer.android.com/training/articles/memory.html
http://developer.android.com/tools/building/multidex.html
您必须阅读此文档,它将改进我们的应用程序
When your application and the libraries it references reach a certain size, you encounter build errors that indicate your app has reached a limit of the Android app build architecture. Earlier versions of the build system report this error as follows:
Conversion to Dalvik format failed:
Unable to execute dex: method ID not in [0, 0xffff]: 65536
But now you can use multidex
build.gradle
我们可以添加任意数量的依赖,没有这样的限制。
Limit 正在使用超过 65K 种方法构建应用程序。参考 link
我最近 1 个月才开始 Android Studio
。 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')
}
在App gradle
中,我们一一添加依赖。
所以我的问题是在 build.gradle
文件中添加依赖项是否有任何限制?
我们最多可以添加多少。如果我们添加很多依赖项,那么它会抛出错误
Conversion to Dalvik format failed:
Unable to execute dex: method ID not in [0, 0xffff]: 65536
提前帮助将不胜感激!!
不,没有限制,但你必须注意这些事情。
http://developer.android.com/training/articles/memory.html http://developer.android.com/tools/building/multidex.html
您必须阅读此文档,它将改进我们的应用程序
When your application and the libraries it references reach a certain size, you encounter build errors that indicate your app has reached a limit of the Android app build architecture. Earlier versions of the build system report this error as follows:
Conversion to Dalvik format failed:
Unable to execute dex: method ID not in [0, 0xffff]: 65536
But now you can use multidex
build.gradle 我们可以添加任意数量的依赖,没有这样的限制。
Limit 正在使用超过 65K 种方法构建应用程序。参考 link