当我要构建项目时,出现此错误,无法构建我的项目或对其进行调试:
Error:java.lang.ClassNotFoundException: Class org.objectweb.asm.tree.ClassNode not found
并在Gradle控制台中:
Exception in thread "main" java.lang.NoClassDefFoundError: org/objectweb/asm/tree/ClassNode
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at com.google.devtools.build.android.desugar.LambdaDesugaring.findTargetMethod(LambdaDesugaring.java:327)
at com.google.devtools.build.android.desugar.LambdaDesugaring.queueUpBridgeMethodIfNeeded(LambdaDesugaring.java:236)
at com.google.devtools.build.android.desugar.LambdaDesugaring.access$200(LambdaDesugaring.java:56)
at com.google.devtools.build.android.desugar.LambdaDesugaring$InvokedynamicRewriter.visitInvokeDynamicInsn(LambdaDesugaring.java:413)
at org.objectweb.asm.ClassReader.readCode(ClassReader.java:1623)
at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1126)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:698)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:500)
at com.google.devtools.build.android.desugar.Desugar.desugarClassesInInput(Desugar.java:477)
at com.google.devtools.build.android.desugar.Desugar.desugarOneInput(Desugar.java:361)
at com.google.devtools.build.android.desugar.Desugar.desugar(Desugar.java:314)
at com.google.devtools.build.android.desugar.Desugar.main(Desugar.java:711)
Caused by: java.lang.ClassNotFoundException: Class org.objectweb.asm.tree.ClassNode not found
at com.google.devtools.build.android.desugar.HeaderClassLoader.findClass(HeaderClassLoader.java:53)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 15 more
FAILED
:app:buildInfoGeneratorDebug
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithDesugarForDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.google.devtools.build.android.desugar.Desugar with arguments {--input C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\59.jar --output C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\desugar\debug\40.jar --input C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\29.jar --output C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\desugar\debug\26.jar --input C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\30.jar --output C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\desugar\debug\27.jar --input C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\54.jar --output C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\desugar\debug\35.jar --input C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\46.jar --output C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\desugar\debug\32.jar --input C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\18.jar --output C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\desugar\debug\17.jar --input C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\43.jar --output C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\desugar\debug\30.jar --input C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\56.jar --output C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\desugar\debug\37.jar --input C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\51.jar --output C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\desugar\debug\33.jar --input C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\27.jar --output C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\desugar\debug\25.jar --input C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\2.jar --output C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\desugar\debug\3.jar --input C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\25.jar --output C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\desugar\debug\23.jar --input C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\21.jar --output C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\desugar\debug\19.jar --input C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\23.jar --output C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\desugar\debug\21.jar --input C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\53.jar --output C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\desugar\debug\34.jar --input C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\12.jar --output C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\desugar\debug\12.jar --input C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\66.jar --output C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\desugar\debug\47.jar --input C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\58.jar --output C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\desugar\debug\39.jar --input C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\17.jar --output C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\desugar\debug\16.jar --input C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\26.jar --output C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\desugar\debug\24.jar --input C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\1.jar --output C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\desugar\debug\2.jar --input C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\44.jar --output C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\desugar\debug\31.jar --input C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\13.jar --output C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\desugar\debug\13.jar --input C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\3.jar --output C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\desugar\debug\4.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\classes\debug --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\0.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\1.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\2.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\3.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\4.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\5.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\6.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\7.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\9.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\10.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\11.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\12.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\13.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\14.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\15.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\17.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\18.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\20.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\21.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\22.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\23.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\24.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\25.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\26.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\27.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\29.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\30.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\31.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\42.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\43.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\44.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\46.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\51.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\53.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\54.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\55.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\56.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\57.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\58.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\59.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\60.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\61.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\62.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\63.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\64.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\65.jar --classpath_entry C:\Users\mostafa\AndroidStudioProjects\ati_school_student_android\app\build\intermediates\transforms\stackFramesFixer\debug\66.jar --bootclasspath_entry C:\Users\mostafa\Documents\SDK\SDK\platforms\android-26\android.jar --bootclasspath_entry C:\Users\mostafa\Documents\SDK\SDK\platforms\android-26\optional\org.apache.http.legacy.jar --bootclasspath_entry C:\Program Files\Google.Android.Studio.v3.0.1.Build.171.4443003\jre\jre\lib\resources.jar --bootclasspath_entry C:\Program Files\Google.Android.Studio.v3.0.1.Build.171.4443003\jre\jre\lib\rt.jar --bootclasspath_entry C:\Program Files\Google.Android.Studio.v3.0.1.Build.171.4443003\jre\jre\lib\jsse.jar --bootclasspath_entry C:\Program Files\Google.Android.Studio.v3.0.1.Build.171.4443003\jre\jre\lib\jce.jar --bootclasspath_entry C:\Program Files\Google.Android.Studio.v3.0.1.Build.171.4443003\jre\jre\lib\charsets.jar --min_sdk_version 17 --desugar_try_with_resources_if_needed --desugar_try_with_resources_omit_runtime_classes --legacy_jacoco_fix}
我的build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "ir.android_studio.ati_school_student"
minSdkVersion 17
targetSdkVersion 26
versionCode 9
versionName "6.7.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = false
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath = true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.0.1'
implementation 'com.android.support:design:26.0.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.android.support:cardview-v7:26.0.1'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.squareup.retrofit:retrofit:2.0.0-beta2'
implementation 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
implementation 'com.squareup.okhttp:okhttp:2.4.0'
implementation 'com.alexzh:circleimageview:1.1.2@aar'
implementation 'com.daimajia.androidanimations:library:1.0.3@aar'
implementation 'com.squareup.picasso:picasso:2.3.2'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.daimajia.slider:library:1.1.5@aar'
implementation 'com.android.support:recyclerview-v7:26.0.1'
implementation 'com.squareup.okhttp:okhttp:2.7.5'
implementation 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'com.wefika:horizontal-picker:1.1.1'
implementation 'me.angrybyte.picker:picker:1.3.0'
implementation 'com.daimajia.easing:library:2.1'
implementation 'com.daimajia.androidanimations:library:2.3'
implementation 'org.jetbrains:annotations-java5:15.0'
implementation 'com.github.samanzamani.persiandate:PersianDate:0.4'
implementation 'com.andrognito.patternlockview:patternlockview:1.0.0'
// Optional, for RxJava2 adapter
implementation 'com.andrognito.patternlockview:patternlockview-reactive:1.0.0'
}
和其他build.gradle:
buildscript {
repositories {
mavenCentral()
google()
jcenter()
maven { url 'https://maven.google.com' }
maven { url "https://jitpack.io" }
maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
google()
jcenter()
maven { url 'https://maven.google.com' }
maven { url "https://jitpack.io" }
maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我试图清洁中间体文件夹,清洁并重建项目。但注意工作! 我搜寻了很多,但没有找到。 如何解决这个问题?