java – Android gms:play-services:8.1.0 DexIndexOverflowException

After I changed GMS: play services: 7.5.0 to 8.1.0, the gradle build failed with multiple DEX exceptions

The error is caused by exceeding the 65K method limit and is fixed by changing the version or deleting several libraries, but it doesn't sound a correct solution because you usually need multiple libraries

What is the best solution to bypass 65K method constraints?

Edit:

The best option is to prevent the dexindexoverflow exception problem by using a separate part of the GMS library, such as com. Google. Android. GMS: play services maps: 8.1.0 or com. Google. Android. GMS: play services identity: 8.1. 0

resolvent:

It seems that the only way to solve the problem is to add

 multiDexEnabled true

Multi DEX support is enabled, but it is only applicable to v21 and later versions

For versions before v21, you need to set multidexenabled to true and add support for multidex:

  compile 'com.android.support:multidex:1.0.1'

Thanks @ nasageek: the best choice is to use each feature version of Google play service to prevent multiple index errors. The complete list of each feature version is here

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>