无法解析库模块中的Kotlin Android扩展布局
我有我的无法解析库模块中的Kotlin Android扩展布局,android,gradle,kotlin,kotlin-android-extensions,Android,Gradle,Kotlin,Kotlin Android Extensions,我有我的买方、卖方模块和一个通用模块。在买方和卖方模块中使用的布局很少放在通用模块中 common -> layout_toolbar.xml buyer -> activity_sell.xml -> <LinearLayout> <include layout="@layout/layout_toolbar" /> <!-- layout_toolbar.xml is from common module --> </Li
买方
、卖方
模块和一个通用
模块。在买方
和卖方
模块中使用的布局很少放在通用
模块中
common -> layout_toolbar.xml
buyer -> activity_sell.xml ->
<LinearLayout>
<include layout="@layout/layout_toolbar" /> <!-- layout_toolbar.xml is from common module -->
</LinearLayout>
seller -> activity_buy.xml ->
<RelativeLayout>
<include layout="@layout/layout_toolbar" /> <!-- layout_toolbar.xml is from common module -->
</RelativeLayout>
buyer -> BuyActivity.kt
toolbar.title = "Buy"
seller -> SellActivity.kt
toolbar.title = "Sell"
common->layout\u toolbar.xml
买家->活动\u sell.xml->
卖家->活动\u buy.xml->
买方->购买活动.kt
toolbar.title=“购买”
卖方->卖方活动.kt
toolbar.title=“出售”
在IDE中一切正常
Unresolved reference: toolbar <-- Id of the toolbar inside layout_toolbar.xml
未解决的引用:工具栏起初这似乎是个好问题。我在当前的项目中重现了相同的问题
我已通过添加库模块
实施项目(“:mylibrary”)
在项目中添加了库模块
在库模块(也称为公共模块)中创建布局/视图
包括在主布局中
最后,我能够以编程方式更改它
将kotlinx.android.synthetic.main.activity\u导入主页*
导入kotlinx.android.synthetic.main.item_库*
构建的环境可能存在一些问题。注意:我使用的是最新的构建版本以及android和kotlin插件
请更新日志,以进一步澄清您的问题。您是否使用命令行或AS构建?如果是,请在命令提示符下尝试。是否已设法解决此问题?