yangchong211 / YCAppTool

🔥🔥🔥 组件化综合案例,组件分层为:基础公共组件,功能组件,业务组件,主工程。每一层组件的建设,很详细的工程案例,很全面的一个组件化实践案例。一个超级综合案例!
3.18k stars 748 forks source link

app安装后报错 #14

Closed ldpGitHub closed 5 years ago

ldpGitHub commented 5 years ago

企业微信截图_15522975839150

ldpGitHub commented 5 years ago

还是崩溃啊,一样的报错

yangchong211 commented 5 years ago

报错日志:RealmException: 'class com.ns.yc.lifehelper.model.cache.CacheHomeNews' is not part of the schema for this Realm. 报错原因:realm与kotlin配置问题,组件化模式下 错误配置【参考方案:https://github.com/realm/realm-java/issues/3139

apply plugin: 'com.android.application'
apply plugin: 'realm-android'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

正确配置【注意:realm-android要在kotlin配置之后】

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'realm-android'

已经解决!