airbnb / epoxy

Epoxy is an Android library for building complex screens in a RecyclerView
https://goo.gl/eIK82p
Apache License 2.0
8.51k stars 728 forks source link

I rebuild project with a @ModelView above my View in an library module, which causes kapt exception with no err message #1254

Open metheway opened 2 years ago

metheway commented 2 years ago

it works fine in an application module, while same code went kapt exception in an library module. epoxy:3.8.0 mavericks.2.2.0

metheway commented 2 years ago

i tried @ModelView(autolayout, defaultlayout....) and even package-info.java to config, but none of them worked

metheway commented 2 years ago

well , there are some exception info: Caused by KotlinNullPointerException: null Stacktrace: com.airbnb.epoxy.ModelViewInfo.findMatchingSetter(ModelViewInfo.kt:292) com.airbnb.epoxy.ModelViewInfo.addProp(ModelViewInfo.kt:192) com.airbnb.epoxy.ModelViewProcessor.processSetterAnnotations(ModelViewProcessor.kt:171) com.airbnb.epoxy.ModelViewProcessor.process(ModelViewProcessor.kt:46) com.airbnb.epoxy.EpoxyProcessor.processRound(EpoxyProcessor.java:193) com.airbnb.epoxy.EpoxyProcessor.process(EpoxyProcessor.java:165) Execution failed for task ':ecp_admin_impl:kaptDebugKotlin'.

trace to the source code : val kotlinMetadata: KotlinClassMetadata? = viewElement.kotlinMetadata as? KotlinClassMetadata

if kotlinMetadata is null, then kotlinClassHeader must be null

two cases it would cause it null: KIND_FIELD_NAME == name && value is Int -> headerKind = KotlinClassHeader.Kind.getById(value)

METADATA_DATA_FIELD_NAME == name -> data = @Suppress("UNCHECKED_CAST") (value as List).toTypedArray()

  1. headerKind == null :
  2. else if ((headerKind == CLASS || headerKind == FILE_FACADE || headerKind == MULTIFILE_CLASS_PART) && data == null) {}

i can't understand why it would be null

chrisjenx commented 2 years ago

epoxy:3.8.0

Any reason you are using a outdated version?