Unable to Resolve Library Activity for Android Test -


i created basic android-maven-project using android-release archetype. 1 thing changed setting android project android library. means have no androidmanifest defining activities. maven build still works helloandroidactivity , helloandroidactivitytest, copying both classes make new test fail:

unable resolve activity for: intent { act=android.intent.action.main flg=0x10000000 cmp=org.acme.project.android/.helloandroidactivity2}

i've searched entire workspace , not find reference helloandroidactivity explain why works activity not one. guess have 2 questions: why integration test work activity not referenced in manifest file? , why doesn't work identical copy of activity?

i don't think matters much, these androidmanifests:

library project:

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"         package="org.acme.project.android"         android:versioncode="1"         android:versionname="1.0-snapshot" >          <uses-sdk android:minsdkversion="8" android:targetsdkversion="16" />      </manifest> 

integration test project:

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"         package="org.acme.project.android.test"         android:versioncode="1"         android:versionname="1.0-snapshot" >          <uses-sdk android:minsdkversion="8" android:targetsdkversion="16" />          <application             android:icon="@drawable/icon"             android:label="@string/app_name" >             <uses-library android:name="android.test.runner" />         </application>          <instrumentation             android:name="android.test.instrumentationtestrunner"             android:targetpackage="org.acme.project.android" />     </manifest> 

without changing thing i'm getting today:

[2014-06-09 08:39:47 - org.acme.project.android.it] test run failed: instrumentation run failed due 'java.lang.classnotfoundexception'

there no additional informtion @ all, not class missing.

i got work. assume last step should necessary, in case didn't work until after proceed entire ordeal:

  1. i set package of integration test project org.acme.project.android (i.e. removed .test) - made eclipse able execute tests
  2. i added .test again, because maven didn't r files in 1 package (illegalargumentexception: added: lorg/acme/project/android/r)
  3. (at point, changes reverted) added activities integration test manifest

as said, first 2 steps should stupid, i've added , removed activities hundred times various manifest files on place, , never worked. maybe thorough cleaning , building after package change needed make changes visible.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -