Kotlin / kotlinx.coroutines

Library support for Kotlin coroutines
Apache License 2.0
13.02k stars 1.85k forks source link

Build failed when kotlinx use xml resource of library on Gradle Plugin 3.X #919

Closed NickHu150 closed 5 years ago

NickHu150 commented 5 years ago

HI, i got a build mistake when i try to upgrade my project's gradle-plugin to 3.2. here is the detail:

All input files are considered out-of-date for incremental task ':app:compileDebugKotlin'. file or directory '/Users/nickhu/Documents/WorkSpace/Android/SourceCode/AndroidCoreHttp/app/src/debug/kotlin', not found file or directory '/Users/nickhu/Documents/WorkSpace/Android/SourceCode/AndroidCoreHttp/app/src/debug/kotlin', not found file or directory '/Users/nickhu/Documents/WorkSpace/Android/SourceCode/AndroidCoreHttp/app/src/debug/java', not found file or directory '/Users/nickhu/Documents/WorkSpace/Android/SourceCode/AndroidCoreHttp/app/src/main/kotlin', not found file or directory '/Users/nickhu/Documents/WorkSpace/Android/SourceCode/AndroidCoreHttp/app/src/main/kotlin', not found file or directory '/Users/nickhu/Documents/WorkSpace/Android/SourceCode/AndroidCoreHttp/app/src/debug/kotlin', not found file or directory '/Users/nickhu/Documents/WorkSpace/Android/SourceCode/AndroidCoreHttp/app/src/debug/kotlin', not found file or directory '/Users/nickhu/Documents/WorkSpace/Android/SourceCode/AndroidCoreHttp/app/src/debug/java', not found file or directory '/Users/nickhu/Documents/WorkSpace/Android/SourceCode/AndroidCoreHttp/app/src/main/kotlin', not found file or directory '/Users/nickhu/Documents/WorkSpace/Android/SourceCode/AndroidCoreHttp/app/src/main/kotlin', not found file or directory '/Users/nickhu/Documents/WorkSpace/Android/SourceCode/AndroidCoreHttp/app/libs', not found Using Kotlin incremental compilation Options for KOTLIN DAEMON: IncrementalCompilationOptions(super=CompilationOptions(compilerMode=INCREMENTAL_COMPILER, targetPlatform=JVM, reportCategories=[0], reportSeverity=2, requestedCompilationResults=[0]), areFileChangesKnown=false, modifiedFiles=null, deletedFiles=null, workingDir=/Users/nickhu/Documents/WorkSpace/Android/SourceCode/AndroidCoreHttp/app/build/kotlin/compileDebugKotlin, customCacheVersionFileName='gradle-format-version.txt', customCacheVersion=4, multiModuleICSettings=MultiModuleICSettings(buildHistoryFile=/Users/nickhu/Documents/WorkSpace/Android/SourceCode/AndroidCoreHttp/app/build/kotlin/compileDebugKotlin/build-history.bin, useModuleDetection=true), usePreciseJavaTracking=truelocalStateDirs=[/Users/nickhu/Documents/WorkSpace/Android/SourceCode/AndroidCoreHttp/app/build/tmp/kotlin-classes/debug])

Task :app:compileDebugKotlin FAILED e: MainActivity.kt: (25, 39): Unresolved reference: test [KOTLIN] deleting /Users/nickhu/Documents/WorkSpace/Android/SourceCode/AndroidCoreHttp/app/build/tmp/kotlin-classes/debug on error [KOTLIN] deleting /Users/nickhu/Documents/WorkSpace/Android/SourceCode/AndroidCoreHttp/app/build/tmp/kotlin-classes/debug on error

there is two modules in project , app and corehttp

build. gradle of app

apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply from: './signature.gradle'

........

dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation project(':corehttp') }

### root build.gradle

buildscript { ext.kotlin_version = '1.3.11' ext.anko_version = '0.10.4' repositories { google() jcenter() maven { url MAVEN_ANDROID } maven { url MAVEN_SNAPSHOT } maven { url MAVEN_APM } } dependencies { classpath 'com.android.tools.build:gradle:3.1.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.squareup.okhttp3:okhttp:3.10.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } }

"test" is a layout xml file in library . i only add this line "import kotlinx.android.synthetic.main.test.*" in MainActivity.kt of app module ,then build failed . is that something wrong? its a simple project and is working at gradle-plugin 2.3.3.

qwwdfsad commented 5 years ago

Is it reproducible with the latest (1.1.1) coroutines?

NickHu150 commented 5 years ago

sorry, i made a mistake.