I updated Android Studio to latest version. Now i can compile my app as debug but when i try to deploy on a device or generate a signed apk gives me following errors:
Error:Execution failed for task ':ribony:transformClassesWithDexForRelease'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException
Error:Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
Error:this warning is that reflective operations on this class will incorrectly
Error:indicate that it is *not* an inner class.
Error:and without specifying any "-target" type options. The consequence of ignoring
Error:solution is to recompile the class from source, using an up-to-date compiler
Error:compiler that did not target the modern .class file format. The recommended
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:(org.xbill.DNS.UDPClient$1) that doesn't come with an
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:indicate that it is *not* an inner class.
Error:this warning is that reflective operations on this class will incorrectly
Error:and without specifying any "-target" type options. The consequence of ignoring
Error:solution is to recompile the class from source, using an up-to-date compiler
Error:compiler that did not target the modern .class file format. The recommended
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:(jnamed$3) that doesn't come with an
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:this warning is that reflective operations on this class will incorrectly
Error:indicate that it is *not* an inner class.
Error:and without specifying any "-target" type options. The consequence of ignoring
Error:solution is to recompile the class from source, using an up-to-date compiler
Error:compiler that did not target the modern .class file format. The recommended
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:(jnamed$2) that doesn't come with an
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:indicate that it is *not* an inner class.
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:solution is to recompile the class from source, using an up-to-date compiler
Error:compiler that did not target the modern .class file format. The recommended
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:(jnamed$1) that doesn't come with an
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
My gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.impact.ribony"
minSdkVersion 14
targetSdkVersion 23
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
lintOptions {
abortOnError false
}
}
dependencies {
compile project(':ion')
compile project(':lib_PagerSlidingTabStrip')
compile 'com.android.support:support-v4:23.0.0'
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.loopj.android:android-async-http:1.4.9'
compile 'com.google.android.gms:play-services-base:8.3.0'
compile 'com.google.android.gms:play-services-analytics:8.3.0'
compile 'com.google.android.gms:play-services-gcm:8.3.0'
compile 'com.google.android.gms:play-services-ads:8.3.0'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.github.chrisbanes:PhotoView:1.3.1'
compile files('libs/android-viewbadger.jar')
compile files('libs/circleimageview-1.2.2-javadoc.jar')
compile files('libs/circleimageview-1.2.2-sources.jar')
compile files('libs/circularimageview-1.1-javadoc.jar')
compile files('libs/dnsjava-2.1.6.jar')
compile files('libs/engine.io-client-0.4.1.jar')
compile files('libs/Java-WebSocket-1.3.0.jar')
compile files('libs/json-org.jar')
compile files('libs/socket.io-client-0.4.1.jar')
}
I guess problem is with same this link: Large number of errors during Gradle build after upgrading to Android Studio 2.0
To resolve this problem i wanted to add
-keepattributes EnclosingMethod
This line to proguard-rules.txt
file. ı couldn't find the file then i created this file by manually at root of my project and I put the line to this file. And nothing changed. Then I found the proguard-android.txt
in Android sdk path. Then added the same line to this file. Then i tried to generate signed apk and again same errors.
How can I resolve this problem?