同时采用shadowOf方法Robolectric编译错误 [英] Robolectric compilation error while using shadowOf method
问题描述
我使用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屋!