当前位置:网站首页>【greenDao】Cannot access ‘org.greenrobot.greendao.AbstractDaoSession‘ which is a supertype of
【greenDao】Cannot access ‘org.greenrobot.greendao.AbstractDaoSession‘ which is a supertype of
2022-08-10 18:39:00 【guangdeshishe】
问题
Cannot access ‘org.greenrobot.greendao.AbstractDaoSession’ which is a supertype of ‘com.xxx.greendao.entity.DaoSession’. Check your module classpath for missing or conflicting dependencies
分析
根据提示,意思是说找不到“DaoSession”的父类“AbstractDaoSession”,而AbstractDaoSession是在’org.greenrobot:greendao:3.3.0’库中,但是依赖的BaseModule中明明有引入implement 'org.greenrobot:greendao:3.3.0',这里涉及到引入依赖库implement和api的区别:
implement 'org.greenrobot:greendao:3.3.0':只有当前Module可引用到里面的类- 假如greenDao是接入到BaseModule中,而AppModule引用BaseModule,这个时候使用
implement引入greenDao则在AppModule中是找不到greenDao库中相关类的
- 假如greenDao是接入到BaseModule中,而AppModule引用BaseModule,这个时候使用
api 'org.greenrobot:greendao:3.3.0':当前Module和引用了当前Module的Modul都可以使用相关类
解决办法
- 将BaseModule中的
implement 'org.greenrobot:greendao:3.3.0'改成api 'org.greenrobot:greendao:3.3.0' - 在AppModule中引用BaseModule模块时,也要使用
api(project(":base"))替换implementation(project(":base"))
边栏推荐
猜你喜欢
随机推荐
【Knowledge Sharing】What is SEI in the field of audio and video development?
MySql主要性能指标说明
第15章_锁
云渲染的应用正在扩大,越来越多的行业需要可视化服务
补坑求逆序对
Win11如何清除最近打开过的文件记录?
「POJ 3666」Making the Grade 题解(两种做法)
Interview Question 04.12. Summation Path-dfs+Auxiliary Array Method
消息队列初见:一起聊聊引入系统mq 之后的问题
[Image segmentation] Image segmentation based on cellular automata with matlab code
瑞吉外卖学习笔记4
【HMS core】【FAQ】AR Engine、Analytics Kit、Video Editor Kit、Image Kit、Map Kit典型问题合集2
含有PEG 间隔基和一个末端伯胺基团(CAS:1006592-62-6)化学试剂
【图像分割】基于元胞自动机实现图像分割附matlab代码
服务器上行带宽和下行带宽指的是什么
FPGA:基础入门按键控制蜂鸣器
TikTok选品有什么技巧?
剑指 Offer II 042. 最近请求次数-队列法
800. 数组元素的目标和(双指针)
从企业的视角来看,数据中台到底意味着什么?








