Thread
#multiplatform
    Dico

    Dico

    3 years ago
    Getting this error when I simply add a mingwX64 target without any configuration to my multiplatform project on version 1.3.21, gradle 4.7:
    kotlin.UninitializedPropertyAccessException: lateinit property compilation has not been initialized
    Caused by: kotlin.UninitializedPropertyAccessException: lateinit property compilation has not been initialized
    	at org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile.getCompilation(KotlinNativeTasks.kt:311)
    	at org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile_Decorated.getCompilation(Unknown Source)
    	at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinNativeCompile$NativeCompilerOpts.setFreeCompilerArgs(KotlinNativeTasks.kt:177)
    	at Build_gradle$2$$special$$inlined$withType$1.execute(DomainObjectCollectionExtensions.kt:58)
    	at org.gradle.internal.Actions$FilteredAction.execute(Actions.java:205)
    	at org.gradle.internal.ImmutableActionSet$CompositeSet.execute(ImmutableActionSet.java:196)
    	at org.gradle.internal.MutableActionSet.execute(MutableActionSet.java:35)
    	at org.gradle.api.internal.DefaultDomainObjectCollection.doAdd(DefaultDomainObjectCollection.java:204)
    	at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:198)
    	at org.gradle.api.internal.DefaultNamedDomainObjectCollection.add(DefaultNamedDomainObjectCollection.java:93)
    	at org.gradle.api.internal.tasks.DefaultTaskContainer.addTask(DefaultTaskContainer.java:187)
    	at org.gradle.api.internal.tasks.DefaultTaskContainer.create(DefaultTaskContainer.java:212)
    	at org.gradle.api.internal.tasks.DefaultTaskContainer.create(DefaultTaskContainer.java:206)
    	at org.jetbrains.kotlin.gradle.plugin.KotlinNativeTargetConfigurator.createKlibCompilationTask(KotlinTargetConfigurator.kt:508)
    	at org.jetbrains.kotlin.gradle.plugin.KotlinNativeTargetConfigurator.access$createKlibCompilationTask(KotlinTargetConfigurator.kt:385)
    	at org.jetbrains.kotlin.gradle.plugin.KotlinNativeTargetConfigurator$configureArchivesAndComponent$$inlined$with$lambda$1.execute(KotlinTargetConfigurator.kt:577)
    	at org.jetbrains.kotlin.gradle.plugin.KotlinNativeTargetConfigurator$configureArchivesAndComponent$$inlined$with$lambda$1.execute(KotlinTargetConfigurator.kt:385)
    	at org.gradle.api.internal.DefaultDomainObjectCollection.all(DefaultDomainObjectCollection.java:136)
    	at org.jetbrains.kotlin.gradle.plugin.KotlinNativeTargetConfigurator.configureArchivesAndComponent(KotlinTargetConfigurator.kt:576)
    	at org.jetbrains.kotlin.gradle.plugin.KotlinNativeTargetConfigurator.configureArchivesAndComponent(KotlinTargetConfigurator.kt:385)
    	at org.jetbrains.kotlin.gradle.plugin.AbstractKotlinTargetConfigurator.configureTarget(KotlinTargetConfigurator.kt:54)
    	at org.jetbrains.kotlin.gradle.plugin.KotlinNativeTargetConfigurator.configureTarget(KotlinTargetConfigurator.kt:567)
    	at org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetPreset.createTarget(kotlinTargetPresets.kt:286)
    	at org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetPreset.createTarget(kotlinTargetPresets.kt:235)
    	at org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtensionKt.configureOrCreate(KotlinMultiplatformExtension.kt:72)
    	at org.jetbrains.kotlin.gradle.dsl.KotlinTargetContainerWithPresetFunctions$DefaultImpls.mingwX64(KotlinTargetContainerWithPresetFunctions.kt:204)
    	at org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension.mingwX64(KotlinMultiplatformExtension.kt:18)
    Getting the same error with gralde 5.2
    s

    svyatoslav.scherbina

    3 years ago
    Can you share your build scripts?
    Dico

    Dico

    3 years ago
    It was caused by an
    allprojects
    block in the parent script, a portion of which had to be wrapped in
    afterEvaluate