问题描述
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

笔者的项目是引入的依赖库是androidx,而GreenDao数据库的测试类依赖的是android包,所以在model项目的build.gradle文件下添加:

useLibrary 'android.test.runner'
useLibrary 'android.test.base'
https://developer.android.google.cn/training/testing/set-up-project
346



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



