Unresolved reference for synthetic view when layout is in library module

前端 未结 10 2114
醉梦人生
醉梦人生 2020-12-12 21:37

using Kotlin 1.20.20 (not that it matters, older versions behaves the same)

When layout is in separate library module Android Studio has no problem finding and refer

10条回答
  •  生来不讨喜
    2020-12-12 22:03

    None of the above answers actually helped me . Add both these plugins in your library module's build.gradle file on top :

    apply plugin: 'kotlin-android-extensions'
    apply plugin: 'kotlin-android'
    

    This should solve the issue .

提交回复
热议问题