Has*_*dou 62 java android google-api android-studio android-gradle-plugin
我使用Android Studio开发应用程序,我遇到这个错误,我不知道如何解决.
com.android.dex.DexIndexOverflowException:方法ID不在[0,0xffff]中
:app:lintVitalRelease
:app:prePackageMarkerForRelease
:app:transformClassesWithDexForRelease FAILED
Error:Execution failed for task ':app:transformClassesWithDexForRelease'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
Information:BUILD FAILED
Information:Total time: 34.783 secs
Information:1 error
Run Code Online (Sandbox Code Playgroud)
Huy*_*Huy 123
尝试在build.gradle中启用multiDex:
android {
defaultConfig {
...
// Enabling multidex support.
multiDexEnabled true
}
...
}
dependencies {
compile 'com.android.support:multidex:1.0.0'
}
Run Code Online (Sandbox Code Playgroud)
本文可能有用:更新到最新的appcompat和支持库后,DexIndexOverflowException问题
vbp*_*vbp 27
Android有一个预先定义的方法上限为65536.
如果您添加了整体播放服务,请将其删除并添加特定的服务.
删除compile 'com.google.android.gms:play-services:9.6.1'
然后添加ex:compile 'com.google.android.gms:play-services-maps:9.6.1'for maps.
https://developers.google.com/android/guides/setup
显示编译应用程序时可以包含的单独API的列表,以及如何在build.gradle文件中描述它们
小智 22
在你的gradle中设置multiDex
defaultConfig {
// ...
multiDexEnabled true
}
Run Code Online (Sandbox Code Playgroud)
这对我有用.
最好的方法是在所有google服务包列表下使用个别包.
Google Play services API Description in build.gradle
Google+ com.google.android.gms:play-services-plus:11.2.0
Google Account Login com.google.android.gms:play-services-auth:11.2.0
Google Actions, Base Client Librarycom.google.android.gms:play-services-base:11.2.0
Google Address API com.google.android.gms:play-services-identity:11.2.0
Google Analytics com.google.android.gms:play-services-analytics:11.2.0
Google Awareness com.google.android.gms:play-services-awareness:11.2.0
Google Cast com.google.android.gms:play-services-cast:11.2.0
Google Cloud Messaging com.google.android.gms:play-services-gcm:11.2.0
Google Drive com.google.android.gms:play-services-drive:11.2.0
Google Fit com.google.android.gms:play-services-fitness:11.2.0
Google Location and Activity Recognition com.google.android.gms:play-services-location:11.2.0
Google Maps com.google.android.gms:play-services-maps:11.2.0
Google Mobile Ads com.google.android.gms:play-services-ads:11.2.0
Google Places com.google.android.gms:play-services-places:11.2.0
Mobile Vision com.google.android.gms:play-services-vision:11.2.0
Google Nearby com.google.android.gms:play-services-nearby:11.2.0
Google Panorama Viewer com.google.android.gms:play-services-panorama:11.2.0
Google Play Game services com.google.android.gms:play-services-games:11.2.0
SafetyNet com.google.android.gms:play-services-safetynet:11.2.0
Android Pay com.google.android.gms:play-services-wallet:11.2.0
Android Wear com.google.android.gms:play-services-wearable:11.2.0
小智 6
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
solution : inside build.gradle(app)
defaultConfig {
applicationId "com.rentalhousereviews"
------------
-----------
multiDexEnabled true //add this line
}
dependencies {
compile 'com.android.support:multidex:1.0.1'
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
80719 次 |
| 最近记录: |