web-dev-qa-db-fra.com

Android Erreur du compilateur Studio Kotlin node.sym ne doit pas être null

Soudainement mon Android studio gradle build échoue avec une erreur inconnue Java.lang.IllegalStateException: échec de l'analyse: com.Sun.tools.javac.util.ClientCodeException: Java.lang.IllegalStateException: node.sym ne doit pas être nul, j'ai essayé tout comme le retour de mon projet à la version précédente et l'invalidation du cache et le redémarrage, mais l'erreur persiste, je ne sais pas vraiment ce qui se passe:

Voici mon diplôme:

ext {
    configuration = [
            compileVersion: 27,
            minSdk        : 14,
            targetSdk     : 25,
            version_code  : 5,
            version_name  : "1.0.0"
    ]

    libraries = [
            supportVersion: '1.0.0-beta01'
    ]
}
buildscript {
    ext.kotlin_version = '1.3.50'

    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.fabric.io/public'
        }
    }
    dependencies {

        classpath 'com.Android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.2.0'
        classpath "io.realm:realm-gradle-plugin:6.0.1"
        classpath 'io.fabric.tools:gradle:1.27.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

//        classpath "com.Android.tools.build:gradle:${buildConfig.gradlePlugin}"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url "https://jitpack.io"
        }
        maven {
            url "https://maven.google.com"
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Construisez le fichier gradle:

apply plugin: 'com.Android.application'
apply plugin: 'kotlin-Android-extensions'
apply plugin: 'kotlin-Android'
apply plugin: 'io.fabric'

apply plugin: 'kotlin-kapt'

apply plugin: 'realm-Android'

Android {
    compileSdkVersion 29
    defaultConfig {
        applicationId "com.social.media.post.graphics.template.card.maker"
        minSdkVersion 21
        targetSdkVersion 29
        versionCode 6
        versionName "1.5"

        multiDexEnabled true

        vectorDrawables.useSupportLibrary = true

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-Android.txt'), 'proguard-rules.pro'
        }
    }

    dexOptions {
        jumboMode true
        javaMaxHeapSize "4g"
    }
    compileOptions {
        sourceCompatibility = 1.8
        targetCompatibility = 1.8
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.github.smarteist:autoimageslider:1.3.2'
    implementation 'me.grantland:autofittextview:0.2.1'
    //noinspection GradleCompatible
    implementation 'org.greenrobot:eventbus:3.1.1'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'com.google.Android.material:material:1.1.0-alpha10'
    implementation 'com.github.QuadFlask:colorpicker:0.0.13'
    implementation 'com.github.kaushikthedeveloper:squarelayout:0.0.3'
    implementation project(':imagelibrary')
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.github.bumptech.glide:glide:4.10.0'
    implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
    implementation 'com.intuit.sdp:sdp-Android:1.0.5'
    implementation 'com.intuit.ssp:ssp-Android:1.0.5'
    implementation 'androidx.percentlayout:percentlayout:1.0.0'
    implementation 'com.github.MasayukiSuda:BubbleLayout:v1.2.1'
    //Fuel
    implementation 'com.github.kittinunf.fuel:fuel:2.2.1'
    implementation 'com.github.kittinunf.fuel:fuel-Android:2.2.1'
    implementation 'com.github.kittinunf.fuel:fuel-gson:2.2.1'

    implementation 'com.google.Android.material:material:1.0.0'
    //Gson
    implementation 'com.google.code.gson:gson:2.7'
    implementation 'com.github.fondesa:kpermissions:2.0.2'
    //Coroutines
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-Android:1.1.0'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-Android:0.30.1-eap13'
    implementation 'com.isseiaoki:simplecropview:1.1.4'
    implementation 'com.github.hotchemi:permissionsdispatcher:2.3.1'
    annotationProcessor 'com.github.hotchemi:permissionsdispatcher-processor:2.3.1'
    // all common code dependencies
    implementation 'com.eyalbira.loadingdots:loading-dots:1.0.2'
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'com.github.sujithkanna:smileyrating:1.6.8'
    implementation 'com.daimajia.slider:library:1.1.5@aar'
    implementation 'com.nineoldandroids:library:2.4.0'
    implementation 'com.github.warkiz.widget:indicatorseekbar:2.1.2'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.3.0-alpha02'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0-alpha02'
    implementation 'com.github.Theophrast:SquareImageView:1.0.1'
    //For Firebase
    implementation 'com.google.firebase:firebase-core:17.2.0'
    implementation 'com.crashlytics.sdk.Android:crashlytics:2.10.1'
    //For Google Mediation
    implementation 'com.google.Android.gms:play-services-ads:18.2.0'
    // For Fb Mediation and FB ads
    implementation 'com.facebook.Android:audience-network-sdk:5.6.0'
    implementation 'com.google.ads.mediation:facebook:5.6.0.0'
    implementation 'com.makeramen:roundedimageview:2.3.0'
    //for unzip .Zip file
    implementation 'com.github.ghost1372:Mzip-Android:0.4.0'
    //lottie animation
    implementation 'com.airbnb.Android:lottie:3.0.7'
    // for equal spacing around recycler view
    /* implementation('com.github.thekhaeng:recycler-margin:1.2.1') {
            exclude group: 'com.Android.support', module: 'recyclerview-v7'
        }*/
    // subscribe and in - app
    implementation 'com.anjlab.Android.iab.v3:library:1.0.44'
    implementation 'androidx.core:core-ktx:+'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    //Sectioned Recyclerview
    implementation 'com.github.IntruderShanky:Sectioned-RecyclerView:2.1.1'
    //Ripple Effect
    implementation 'com.github.traex.rippleeffect:library:1.3'
    //Tagview
    compile 'com.veinhorn.tagview:library:1.0.4'
}
apply plugin: 'com.google.gms.google-services'
repositories {
    mavenCentral()
}
9
R.Coder

Cela s'est également produit lorsque la source est définie comme:

sourceSets {
    main {
        Java.srcDirs += 'build/generated/data_binding_base_class_source_out/'
    }
 }

Et il existe plusieurs types de construction. Les dossiers dans data_binding_base_class_source_out interceptent et cela cause le problème.

Correction:

sourceSets {
    debug {
          Java.srcDirs += 'build/generated/data_binding_base_class_source_out/debug/'
    }
    release {
        Java.srcDirs += 'build/generated/data_binding_base_class_source_out/release/'
    }
}
1
Mike

J'ai eu ce problème plusieurs fois.

La seule chose qui a fonctionné pour moi est la mise à niveau/rétrogradation Android Gradle Plugin. Essayez d'utiliser la version 3.5.3.

Dans mon cas, j'utilisais 3.6.0-rc02. Après le passage à la version 3.5.3, le problème a disparu.

0
Maragues