Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In your Test Project <strong>T</strong>, if you have SomeActivityTest that explicitly import/use some package/class from Library Project <strong>B</strong> and/or <strong>C</strong>, you have to add the Library Project as a dependency of Test project, as the referenced package/class is required at project build time. if you don't, you will get the following error when compile you Test Project:</p> <pre><code>[javac] SomeActivityTest.java:8: package com.mydomain.portal.android.project.activity does not exist [javac] import com.mydomain.portal.android.project.activity.SomeClass1; [javac] ^ [javac] SomeActivityTest.java:9: package com.mydomain.portal.android.project.data does not exist </code></pre> <p>If you add Library Project as dependency in both Main Project and Test Project, and use Ant build you test project, it cause duplicate entries at dexing step. Eclipse ADT plugin knows how to hanlde this situation properly so you don't get this trouble when build with Eclipse:</p> <pre><code>[dx] UNEXPECTED TOP-LEVEL EXCEPTION: [dx] java.lang.IllegalArgumentException: already added: Lcom/mydomain/...; [dx] at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123) [dx] at com.android.dx.dex.file.DexFile.add(DexFile.java:163) </code></pre> <p>Currently, there is a workaround (dirty fix in ant script), check out my answer <a href="https://stackoverflow.com/questions/9513517/unexpected-top-level-exception-after-sdk-update">here</a> for details.</p> <p>Note that the most recent SDK release r17 which got many bug fix and improvement. According to the <a href="http://tools.android.com/recent/dealingwithdependenciesinandroidprojects" rel="nofollow noreferrer">changelog</a>, it claims that now SDK can deal with duplicate dependencies more smarter, although I haven't tired myself with Test Project yet. Probably you can give it a shot and see if it works. Hope this helps.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload