我正在使用Espresso来测试我的应用程序。
我还使用库uk.com.robust-it:cloning
(Java Deep Cloning Library)版本 1.9.2 来克隆对象。
如果我正在使用该应用程序,我没有例外,但是当测试运行时,我有以下例外:
org.objenesis.ObjenesisException: java.lang.NoSuchMethodException: newInstance [class java.lang.Class, int]
at org.objenesis.instantiator.android.AndroidInstantiator.getNewInstanceMethod(AndroidInstantiator.java:62)
at org.objenesis.instantiator.android.AndroidInstantiator.<init>(AndroidInstantiator.java:38)
at org.objenesis.strategy.StdInstantiatorStrategy.newInstantiatorOf(StdInstantiatorStrategy.java:75)
at org.objenesis.ObjenesisBase.getInstantiatorOf(ObjenesisBase.java:90)
at org.objenesis.ObjenesisBase.newInstance(ObjenesisBase.java:73)
at com.rits.cloning.ObjenesisInstantiationStrategy.newInstance(ObjenesisInstantiationStrategy.java:18)
at com.rits.cloning.Cloner.newInstance(Cloner.java:271)
at com.rits.cloning.Cloner.cloneObject(Cloner.java:436)
at com.rits.cloning.Cloner.cloneInternal(Cloner.java:431)
at com.rits.cloning.Cloner.deepClone(Cloner.java:301)
有人也有这个例外吗?
这家伙和我有同样的问题......
https://groups.google.com/forum/#!topic/objenesis-dev/jdqWCwy5E78