【发布时间】:2016-08-30 19:29:45
【问题描述】:
我有一个安卓应用。我可以在我的设备上毫无问题地运行它,但是当我尝试构建 apk 文件时,出现以下错误。
Error:warning: Ignoring InnerClasses attribute for an anonymous innerclass
Error:(org.joda.time.DateTimeZone$1) that doesn't come with an
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:compiler that did not target the modern .class file format. The recommended
Error:solution is to recompile the class from source, using an up-to- date compiler
Error:and without specifying any "-target" type options. The consequence of ignoring
Error:this warning is that reflective operations on this class will incorrectly
Error:indicate that it is *not* an inner class.
Error:The number of method references in a .dex file cannot exceed 64K.
Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
:app:transformClassesWithDexForDebug FAILED
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.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
这是我的依赖项:
dependencies {
compile 'com.google.android.gms:play-services:+'
compile 'com.google.code.gson:gson:2.1'
compile 'com.google.guava:guava:11.0.1'
compile 'com.google.protobuf:protobuf-java:2.2.0'
compile files('libs/acra-4.5.0.jar')
compile files('libs/google-api-client-1.10.3-beta.jar')
compile files('libs/google-api-client-android2-1.10.3-beta.jar')
compile files('libs/google-http-client-1.10.3-beta.jar')
compile files('libs/google-http-client-android2-1.10.3-beta.jar')
compile files('libs/google-oauth-client-1.10.1-beta.jar')
compile files('libs/jackson-core-asl-1.9.4.jar')
compile files('libs/jsr305-1.3.9.jar')
compile files('/Users/emredurmus/Documents/Projects/CrmMobile1/Libs/odata4j-0.7.0-clientbundle.jar')
compile 'com.google.android.gms:play-services:+'}
我该怎么办?
谢谢
【问题讨论】:
-
您是否尝试过清理和重建项目?我之前也遇到了同样的错误。我也做过同样的事情。它对我有用
-
是的,我做到了。它在我的真实设备上也能正常工作。问题是当我尝试创建 apk 时。
标签: android android-studio gradle apk