paperparcel icon indicating copy to clipboard operation
paperparcel copied to clipboard

Build failure with Kotlin 1.1.4-3 and KAPT.

Open rjoncontract opened this issue 7 years ago • 1 comments

Looks like the fields that are being generated have different names from the ones that are defined in the data class.

Data Class

@PaperParcel
data class User(
    val id: Long,
    val firstName: String,
    val lastName: String
) : PaperParcelable {
  companion object {
    @JvmField val CREATOR = PaperParcelUser.CREATOR
  }
}

Build Error

Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:compileDebugAndroidTestSources, :app:compileDebugUnitTestSources, :app:compileDebugSources]
Error:No field match found for the constructor parameter "arg0" in com.example.login.User. Constructor arguments are matched with fields via their name and type.
Error:No field match found for the constructor parameter "arg1" in com.example.login.User. Constructor arguments are matched with fields via their name and type.
Error:No field match found for the constructor parameter "arg2" in com.example.login.User. Constructor arguments are matched with fields via their name and type.
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

PS: I am using Android Studio 3.-0 Beta 7

rjoncontract avatar Oct 11 '17 18:10 rjoncontract

Did you apply the kotlin-kapt plugin?

grandstaish avatar Oct 12 '17 09:10 grandstaish