Using android data binding, now all types are unresolved reference


#1

I just added some data binding usage to my Android app. Now I ran it once, my app did not get very far. So I tried to run it again. I got a slew of errors. The errors happen when I choose “Debug ‘app’”. I can “make project” fine. Seems like a big issue here. Tried deleting build dir from disk, no help.

Executing tasks: [:app:assembleDebug]

Configuration on demand is an incubating feature.
Observed package id ‘add-ons;addon-google_apis-google-23’ in inconsistent location ‘/Volumes/Scintillate/Android/sdk/add-ons/addon-google_apis-google-23-1’ (Expected ‘/Volumes/Scintillate/Android/sdk/add-ons/addon-google_apis-google-23’)
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidDatabindingAdapters11Library UP-TO-DATE
:app:prepareComAndroidDatabindingLibrary11Library UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2340Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72340Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72340Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2340Library UP-TO-DATE
:app:prepareComAndroidSupportPercent2340Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72340Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV132340Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42340Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2340Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:dataBindingProcessLayoutsDebug UP-TO-DATE
:app:compileDebugAidl UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:dataBindingExportBuildInfoDebug UP-TO-DATE
:app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:app:compileDebugKotlin UP-TO-DATE
:app:compileDebugJavaWithJavac
:app:compileDebugKotlinAfterJava
e: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
class android.support.percent.PercentRelativeLayout, unresolved supertypes: RelativeLayout
class android.support.percent.PercentFrameLayout, unresolved supertypes: FrameLayout
class android.support.percent.PercentLayoutHelper, unresolved supertypes: Object
class letstwinkle.com.twinkle.R.drawable, unresolved supertypes: Object
class kotlin.Pair, unresolved supertypes: java.io.Serializable
class android.databinding.BaseObservable, unresolved supertypes: Object
class android.databinding.Observable, unresolved supertypes: Object
class letstwinkle.com.twinkle.R.layout, unresolved supertypes: Object
class android.databinding.DataBindingComponent, unresolved supertypes: Object
class android.databinding.DataBindingUtil, unresolved supertypes: Object

e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/DSL.kt: (3, 8): Unresolved reference: java
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/DSL.kt: (6, 5): Unresolved reference: StringBuilder
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/DSL.kt: (7, 24): ‘this’ is not defined in this context
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/DSL.kt: (11, 38): Unresolved reference: Appendable
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/DSL.kt: (12, 35): Unresolved reference: Appendable
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/DSL.kt: (15, 13): Unresolved reference: StringBuilder
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/DSL.kt: (19, 20): Unresolved reference: LinkedHashMap
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/DSL.kt: (24, 47): Unresolved reference: Appendable
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/DSL.kt: (58, 15): Unresolved reference: ArrayList
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/DSL.kt: (58, 25): Unresolved reference: Arrays
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/DSL.kt: (65, 47): Unresolved reference: Appendable
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Json.kt: (3, 8): Unresolved reference: java
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Json.kt: (12, 12): Unresolved reference: BigInteger
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Json.kt: (16, 23): Unresolved reference: IllegalArgumentException
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Json.kt: (29, 24): Cannot access class ‘java.util.LinkedHashMap’. Check your module classpath for missing or conflicting dependencies
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Json.kt: (29, 43): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public inline fun <K, V, R> Map<???, ???>.mapValues(transform: (Map.Entry<???, ???>) -> ???): Map<???, ???> defined in kotlin.collections
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Json.kt: (29, 62): Unresolved reference: it
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Lexer.kt: (3, 8): Unresolved reference: java
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Lexer.kt: (4, 8): Unresolved reference: java
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Lexer.kt: (25, 31): Unresolved reference: InputStream
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Lexer.kt: (30, 19): Unresolved reference: Pattern
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Lexer.kt: (31, 18): Unresolved reference: Pattern
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Lexer.kt: (51, 41): Unresolved reference: Character
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Lexer.kt: (69, 28): Unresolved reference: StringBuilder
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Lexer.kt: (81, 27): Unresolved reference: RuntimeException
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Lexer.kt: (88, 35): Unresolved reference: RuntimeException
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Lexer.kt: (101, 51): Unresolved reference: StringBuilder
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Lexer.kt: (107, 48): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public val KClass<???>.java: Class<???> defined in kotlin.jvm
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Lexer.kt: (143, 33): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public val KClass<???>.java: Class<???> defined in kotlin.jvm
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Lexer.kt: (144, 29): Unresolved reference: NumberFormatException
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Lexer.kt: (146, 37): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public val KClass<???>.java: Class<???> defined in kotlin.jvm
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Lexer.kt: (147, 32): Unresolved reference: NumberFormatException
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Lexer.kt: (148, 37): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public val KClass<???>.java: Class<???> defined in kotlin.jvm
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Lexer.kt: (152, 29): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public val KClass<???>.java: Class<???> defined in kotlin.jvm
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Lexer.kt: (160, 23): Unresolved reference: RuntimeException
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Lookup.kt: (3, 8): Unresolved reference: java
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Lookup.kt: (4, 8): Unresolved reference: java
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Lookup.kt: (24, 44): Unresolved reference: BigInteger
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Lookup.kt: (24, 76): Unresolved reference: BigInteger
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Lookup.kt: (34, 49): Unresolved reference: BigInteger
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Lookup.kt: (38, 29): Unresolved reference: ArrayList
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Lookup.kt: (45, 29): Unresolved reference: ArrayList
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Lookup.kt: (65, 39): Unresolved reference: IllegalArgumentException
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Parser.kt: (3, 8): Unresolved reference: java
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Parser.kt: (4, 8): Unresolved reference: java
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Parser.kt: (5, 8): Unresolved reference: java
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Parser.kt: (6, 8): Unresolved reference: java
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Parser.kt: (9, 31): Unresolved reference: LinkedList
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Parser.kt: (10, 30): Unresolved reference: LinkedList
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Parser.kt: (60, 23): Cannot access class ‘java.util.HashMap’. Check your module classpath for missing or conflicting dependencies
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Parser.kt: (63, 9): Cannot access class ‘java.util.HashMap’. Check your module classpath for missing or conflicting dependencies
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Parser.kt: (63, 13): Unresolved reference: put
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Parser.kt: (68, 25): Cannot access class ‘java.util.HashMap’. Check your module classpath for missing or conflicting dependencies
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Parser.kt: (68, 29): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public operator fun JsonArray<*>.get(key: String): JsonArray<Any?> defined in com.beust.klaxon
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Parser.kt: (73, 19): Unresolved reference: RuntimeException
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Parser.kt: (94, 9): Unresolved reference: FileInputStream
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Parser.kt: (94, 25): Unresolved reference: File
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Parser.kt: (95, 19): Unresolved reference: it
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Parser.kt: (98, 29): Unresolved reference: InputStream
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Render.kt: (3, 17): Unresolved reference: Appendable
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Render.kt: (34, 42): Unresolved reference: Appendable
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/com/beust/klaxon/Render.kt: (49, 5): Unresolved reference: Appendable
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/GlobalUI.kt: (8, 16): Unresolved reference: content
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/GlobalUI.kt: (11, 83): Unresolved reference: Context
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayActivity.kt: (8, 16): Unresolved reference: app
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayActivity.kt: (10, 16): Unresolved reference: os
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayActivity.kt: (11, 16): Unresolved reference: os
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayActivity.kt: (12, 16): Unresolved reference: util
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayActivity.kt: (18, 36): Unresolved reference: Activity
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayActivity.kt: (31, 23): Unresolved reference: Handler
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayActivity.kt: (56, 5): ‘onCreate’ overrides nothing
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayActivity.kt: (56, 47): Unresolved reference: Bundle
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayActivity.kt: (57, 9): Unresolved reference: Log
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayActivity.kt: (58, 15): Unresolved reference: onCreate
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayActivity.kt: (59, 44): Type inference failed: fun <T : ViewDataBinding!> setContentView(activity: Activity!, layoutId: Int): T!
cannot be applied to
(MatchPlayActivity,Int)

e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayActivity.kt: (59, 44): Cannot access class ‘android.app.Activity’. Check your module classpath for missing or conflicting dependencies
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayActivity.kt: (59, 59): Type mismatch: inferred type is MatchPlayActivity but Activity! was expected
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayActivity.kt: (66, 5): ‘onPause’ overrides nothing
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayActivity.kt: (67, 15): Unresolved reference: onPause
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayActivity.kt: (72, 5): ‘onResume’ overrides nothing
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayActivity.kt: (73, 15): Unresolved reference: onResume
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayActivity.kt: (79, 5): ‘onSaveInstanceState’ overrides nothing
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayActivity.kt: (79, 48): Unresolved reference: Bundle
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayActivity.kt: (80, 15): Unresolved reference: onSaveInstanceState
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayActivity.kt: (83, 5): ‘onRestoreInstanceState’ overrides nothing
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayActivity.kt: (83, 61): Unresolved reference: Bundle
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayActivity.kt: (84, 15): Unresolved reference: onRestoreInstanceState
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayAvatarView.kt: (8, 16): Unresolved reference: content
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayAvatarView.kt: (9, 16): Unresolved reference: graphics
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayAvatarView.kt: (10, 16): Unresolved reference: util
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayAvatarView.kt: (11, 16): Unresolved reference: widget
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayAvatarView.kt: (13, 29): Unresolved reference: ImageView
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayAvatarView.kt: (14, 22): Unresolved reference: Context
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayAvatarView.kt: (14, 39): Too many arguments for public constructor Any() defined in kotlin.Any
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayAvatarView.kt: (15, 22): Unresolved reference: Context
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayAvatarView.kt: (15, 38): Unresolved reference: AttributeSet
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayAvatarView.kt: (15, 60): Too many arguments for public constructor Any() defined in kotlin.Any
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayAvatarView.kt: (15, 65): Too many arguments for public constructor Any() defined in kotlin.Any
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayAvatarView.kt: (20, 22): Unresolved reference: context
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayAvatarView.kt: (25, 22): Unresolved reference: context
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayAvatarView.kt: (30, 5): ‘onDraw’ overrides nothing
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayAvatarView.kt: (30, 33): Unresolved reference: Canvas
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayAvatarView.kt: (31, 15): Unresolved reference: onDraw
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayFeatureView.kt: (8, 16): Unresolved reference: content
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayFeatureView.kt: (11, 33): Unresolved reference: Context
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayFeatureView.kt: (11, 44): Cannot access class ‘android.content.Context’. Check your module classpath for missing or conflicting dependencies
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayPickerView.kt: (8, 16): Unresolved reference: content
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayPickerView.kt: (10, 16): Unresolved reference: util
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayPickerView.kt: (11, 16): Unresolved reference: util
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayPickerView.kt: (13, 8): Unresolved reference: java
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayPickerView.kt: (14, 8): Unresolved reference: java
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayPickerView.kt: (21, 22): Unresolved reference: Context
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayPickerView.kt: (21, 33): Cannot access class ‘android.content.Context’. Check your module classpath for missing or conflicting dependencies
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayPickerView.kt: (22, 22): Unresolved reference: Context
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayPickerView.kt: (22, 38): Unresolved reference: AttributeSet
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayPickerView.kt: (22, 54): Cannot access class ‘android.content.Context’. Check your module classpath for missing or conflicting dependencies
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayPickerView.kt: (22, 54): Cannot access class ‘android.util.AttributeSet’. Check your module classpath for missing or conflicting dependencies
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayPickerView.kt: (44, 31): Unresolved reference: Timer
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayPickerView.kt: (44, 39): Unresolved reference: Timer
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayPickerView.kt: (59, 82): Unresolved reference: context
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayPickerView.kt: (68, 9): Unresolved reference: Log
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayPickerView.kt: (72, 9): Unresolved reference: Log
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayPickerView.kt: (76, 9): Unresolved reference: Log
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayPickerView.kt: (80, 5): ‘onFinishInflate’ overrides nothing
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayPickerView.kt: (81, 15): Unresolved reference: onFinishInflate
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayPickerView.kt: (82, 51): Cannot access class ‘android.view.View’. Check your module classpath for missing or conflicting dependencies
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayPickerView.kt: (82, 56): Type mismatch: inferred type is MatchPlayPickerView but View! was expected
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayPickerView.kt: (86, 57): Unresolved reference: TimerTask
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayPickerView.kt: (87, 18): Unresolved reference: WeakReference
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayPickerView.kt: (88, 5): ‘run’ overrides nothing
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/MatchPlayPickerView.kt: (89, 9): Unresolved reference: Log
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/profile/PhotoMedia.kt: (8, 16): Unresolved reference: graphics
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/profile/PhotoMedia.kt: (9, 16): Unresolved reference: graphics
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/profile/PhotoMedia.kt: (13, 28): Unresolved reference: Rect
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/profile/PhotoMedia.kt: (13, 35): Unresolved reference: Rect
e: /Users/julian/AndroidStudioProjects/Twinkle/app/src/main/kotlin/letstwinkle/com/twinkle/profile/PhotoMedia.kt: (14, 17): Unresolved reference: Bitmap

FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app:compileDebugKotlinAfterJava’.

Compilation error. See log for more details

  • Try:
    Run with --info or --debug option to get more log output.

  • Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ‘:app:compileDebugKotlinAfterJava’.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
    at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
    at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:153)
    at org.gradle.internal.Factories$1.create(Factories.java:22)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:150)
    at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:98)
    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:92)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:99)
    at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:46)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.tooling.internal.provider.runner.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:58)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:48)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:52)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:47)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:237)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
    Caused by: org.gradle.api.GradleException: Compilation error. See log for more details
    at org.jetbrains.kotlin.gradle.tasks.KotlinCompile$callCompiler$10.invoke(Tasks.kt:355)
    at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompiler(Tasks.kt:364)
    at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompiler(Tasks.kt:148)
    at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile.execute(Tasks.kt:110)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:245)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:232)
    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
    … 70 more

BUILD FAILED

Total time: 11.94 secs


#2

Did you enable kapt in your build script? http://kotlinlang.org/docs/reference/using-gradle.html#annotation-processing


#3

Yes I think I have everything. Here: (cannot attach .gradle files, lol)

— project
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.0.3'
    ext.gradle_version = '2.1.3'
    repositories {
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:$gradle_version"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

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

allprojects {
    repositories {
        jcenter()
    }
}

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

— app
apply plugin: 'com.android.application’
apply plugin: ‘kotlin-android’

android {
    compileSdkVersion 23
    buildToolsVersion "24.0.1"

    defaultConfig {
        applicationId "letstwinkle.com.twinkle"
        minSdkVersion 21
        targetSdkVersion 23
        versionCode 1
        versionName "1.0a1"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }
    dataBinding {
        enabled = true
    }
    dexOptions {
        incremental true
        javaMaxHeapSize "3g"
    }
}

dependencies {
    kapt "com.android.databinding:compiler:$gradle_version"
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    compile "com.android.support:support-v4:23.4.0"
    compile "com.android.support:cardview-v7:23.4.0"
    compile "com.android.support:support-annotations:23.4.0"
    compile "com.android.support:percent:23.4.0"
    compile "com.android.support:design:23.4.0"
    compile "com.android.support:support-v13:23.4.0"
    compile "com.nostra13.universalimageloader:universal-image-loader:1.9.5"
}
kapt {
    generateStubs = true
}
repositories {
    mavenCentral()
}

#4

using AS 2.2 RC. This might be just an issue with changing to 2.2 and not even databinding related.


#5

Could you please try Kotlin 1.0.4 EAP and see if it resolves the problem?


#6

You can have a look at https://github.com/LostInContext/LostContext-App
if you want a sample project where kotlin, dagger 2 and DataBinding are used side by side.

However, note that the kotlin plugin for Intellij does not work very well with DataBinding.
Binding.someWidget is always marked as error in the IDE, making using one of the best android libraries extremely annoying in kotlin.

It compiles fine, but I hope that the tooling will get fixed soon.

issue for reference : https://youtrack.jetbrains.com/issue/KT-12402


#7

I will try this once I can use 1.0.4 EAP (I posted on the EAP topic) :S


#8

As the first step of the instructions says, please add https://dl.bintray.com/kotlin/kotlin-eap to your repositories. This applies to both the buildscript block and the regular dependencies block.


#9

So far, I am not seeing this problem with 1.0.4 EAP :slight_smile: