
[英]Robolectric & Gradle: error: cannot access BufferedImage class file for java.awt.image.BufferedImage not found
[英]Robolectric 3.2.2 cannot access Icon
因此,我尝试从Robolectric 3.1-rc1迁移到Robolectric 3.2.2。 每当我要构建我的Android项目时,都会出现以下错误:
error: cannot access Icon
Intent lastStartedActivity = shadowOf(activity).getNextStartedActivity();
^
class file for android.graphics.drawable.Icon not found
该错误在我的第一个Test类中弹出。 我不知道我做错了什么。 我的Testclasses使用自RobolectricTestRunner扩展的自定义TestRunner,并重写buildGlobalConfig()方法,如下所示:
@Override protected Config buildGlobalConfig() {
return new Config.Builder().setSdk(21).setManifest(Config.DEFAULT_MANIFEST_NAME).setQualifiers(Config.DEFAULT_QUALIFIERS)
.setPackageName(Config.DEFAULT_PACKAGE_NAME).setResourceDir(Config.DEFAULT_RES_FOLDER).setAssetDir(Config.DEFAULT_ASSET_FOLDER)
.setBuildDir(Config.DEFAULT_BUILD_FOLDER).setConstants(BuildConfig.class).build();
}
也许某些Robolectric专家可以提供帮助?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.