From 108e91f2a24ffcef922696c825691e2268de6103 Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Wed, 10 Jan 2018 00:48:30 +0900 Subject: [PATCH] Kapt: Be less strict when it's impossible to add a generated Kotlin source directory for Android project (KT-22056, EA-114271) --- .../kotlin/kapt/idea/KaptProjectResolverExtension.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/kapt3/kapt3-idea/src/org/jetbrains/kotlin/kapt/idea/KaptProjectResolverExtension.kt b/plugins/kapt3/kapt3-idea/src/org/jetbrains/kotlin/kapt/idea/KaptProjectResolverExtension.kt index 291185bf37b..6d13ef61a29 100644 --- a/plugins/kapt3/kapt3-idea/src/org/jetbrains/kotlin/kapt/idea/KaptProjectResolverExtension.kt +++ b/plugins/kapt3/kapt3-idea/src/org/jetbrains/kotlin/kapt/idea/KaptProjectResolverExtension.kt @@ -116,8 +116,9 @@ class KaptProjectResolverExtension : AbstractProjectResolverExtension() { try { sourceSet.generatedKotlinSourcesDirFile?.let { variant.mainArtifact.generatedSourceFolders += it } } catch (e: Throwable) { - LOG.error(RuntimeException( - "Kapt importer for generated source roots failed, source root name: ${sourceSet.sourceSetName}", e)) + // There was an error being thrown here, but the code above doesn't work for the newer versions of Android Studio 3 + // (generatedSourceFolders returns a wrapped unmodifiable list), and the thrown exception breaks the import. + // The error will be moved back when I find a work-around for AS3. } } }