samedi 5 avril 2014

Android Unit Test - ClassdefNotFound


Vote count:

0




I am trying to write a unit test for Android, but I get a "NoClassdefFound"-error when executing following very simple code in one of my test methods:



public void testAAA(){
testAPI1 test = new testAPI1();
test.makeApiCall1();
}


The class testAPI1 looks like this:



public class testAPI1 implements SomeInterface{
public void makeApiCall1(){
//do something
}


}


SomeInterface is, well, just some interface. When I remove "SomeInterface", however, everything works fine.


The manifest file:



<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://ift.tt/nIICcg"
package="com.mamlambo.article.simplecalc.test" android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon"
android:label="@string/app_name">
<uses-library android:name="android.test.runner" />
</application>

<uses-sdk android:minSdkVersion="7" />
<instrumentation android:targetPackage="com.mamlambo.article.simplecalc"
android:name="android.test.InstrumentationTestRunner"
android:label="Simple Calc Test"/>
</manifest>


What exactly is the problem?



asked 2 mins ago






Aucun commentaire:

Enregistrer un commentaire