Skip to content Skip to sidebar Skip to footer

Stand-alone Test Project For A Library Project On Android

My question is: How do I create an Android stand-alone test project for an Android library? I've got my Android library (which is marked as 'Library' in the project settings) and a

Solution 1:

Ah, the answer is so simple. The error is in the Android manifest of the test project in line 3: Here the wrong package is mentioned. So the corrected manifest looks like this:

<?xml version="1.0" encoding="utf-8"?><manifestxmlns:android="http://schemas.android.com/apk/res/android"package="com.mayastudios"android:versionCode="1"android:versionName="1.0" ><uses-sdkandroid:minSdkVersion="10" /><instrumentationandroid:name="android.test.InstrumentationTestRunner"android:targetPackage="com.mayastudios" /><uses-permissionandroid:name="android.permission.WRITE_EXTERNAL_STORAGE"/><applicationandroid:label="Spatialite-NewApi-UnitTests"><uses-libraryandroid:name="android.test.runner" /></application></manifest>

And to all who say that you need three projects (library, project-under-test, test project): They're wrong. A library project and a test project are enough. The test project doesn't even need to contain an Activity.

Post a Comment for "Stand-alone Test Project For A Library Project On Android"