我将Android Studio更新到最新版本。现在我可以将我的应用程序编译为调试,但是当我尝试在设备上部署或生成已签名的apk时,会出现以下错误:
{ path: '', component: BillingComponent }
我的gradle文件:
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
我猜问题与此链接相同:Large number of errors during Gradle build after upgrading to Android Studio 2.0
要解决此问题,我想添加
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')
}
此行到-keepattributes EnclosingMethod
文件。 ı找不到文件,然后我在我的项目的根目录手动创建此文件,我把行放到这个文件。没有任何改变。然后我在Android sdk路径中找到了proguard-rules.txt
。然后将相同的行添加到此文件中。然后我试图生成签名的apk和再次相同的错误。
如何解决此问题?