问题描述
kotlin项目中引入GreenDao数据库,在编译并运行时出现如下问题:
Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
class org.greenrobot.greendao.test.DbTest, unresolved supertypes: android.test.AndroidTestCase
原因分析:
缺少:android.test.AndroidTestCase

笔者的项目是引入的依赖库是a

本文主要介绍了在使用Android Studio进行Kotlin开发时,遇到GreenDao测试类`org.greenrobot.greendao.test.DbTest`无法解析其父类型`android.test.AndroidTestCase`的问题。问题根源在于项目依赖了androidx库,而GreenDao的测试类依赖的是android包。解决方法是在model项目的build.gradle文件中添加对应的依赖。
最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



