title: Cloning an object in java: org.objenesis.ObjenesisException: java.lang.NoSuchMethodException: newInstance [class java.lang.Class, int]
body: <p>I am using Espresso to test my application.</p>
  
  <p>I am also using the library <code>uk.com.robust-it:cloning</code>  (<a href="https://code.google.com/p/cloning/" rel="nofollow">Java Deep Cloning Library</a>)  version <strong>1.9.2</strong> to clone an object.</p>
  
  <p>If I am using the application, I have no exception, but when the tests are running, I have the following exception:</p>
  
  <pre><code>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.&lt;init&gt;(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)
  </code></pre>
  
  <p>Does someone also have this exception? </p>
  
  <p>This guy has the same problem that I ...</p>
  
  <p><a href="https://groups.google.com/forum/#!topic/objenesis-dev/jdqWCwy5E78" rel="nofollow">https://groups.google.com/forum/#!topic/objenesis-dev/jdqWCwy5E78</a></p>