同时采用shadowOf方法Robolectric编译错误 [英] Robolectric compilation error while using shadowOf method

查看:113
本文介绍了同时采用shadowOf方法Robolectric编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Robolectric 1.2在2.3.3的Andorid项目(API 10)结果
它抛出下面的编译错误,使用shadowOf方法时

I am using Robolectric 1.2 in an Andorid 2.3.3 project (API 10)
It throws the below compilation error, when using shadowOf method

ShadowView shadowView = Robolectric.shadowOf(view);

错误:无法访问ObjectAnimator

error: cannot access ObjectAnimator

但是,错误消失,如果我改变了Android SDK API到11以上。

But the error is gone, if I change the android sdk to API 11 and above

推荐答案

在一些分析,发现它是robolectric的错误。

After some analysis, found that it is a bug in robolectric.

目前,使用2.0-α-1似乎解决这​​个问题。

For now, using 2.0-alpha-1 seems to fix the issue.

下面是问题的结果创造了GitHub的问题
https://github.com/pivotal/robolectric/issues/431

Here is the github issue created for the issue
https://github.com/pivotal/robolectric/issues/431

这篇关于同时采用shadowOf方法Robolectric编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆