Android libraries in ADT: type cannot be resolved error
<p>In essence: a library project declares a Activity, a implementation project uses (subclass) this Activity and a test project exercises the implemented version. In this scenary we found "The type  cannot be resolved. It is indirectly referenced from required .class files". If changed to ADT r13 no problems reported.
Code to issue reproduction:
In library:</p>

<pre><code>package com.r14.error.lib;
import android.app.Activity;
import android.os.Bundle;

public class R14ErrorLibActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
}
</code></pre>

<p>In implementation:</p>

<pre><code>package com.r14.error.imp;
import com.r14.error.lib.R14ErrorLibActivity;

public class R14ErrorImpActivity extends R14ErrorLibActivity {
}
</code></pre>

<p>In test:</p>

<pre><code>package com.r14.error.imp.test;    
import com.r14.error.imp.R14ErrorImpActivity;    
import android.test.ActivityUnitTestCase;

public class R14ErrorLibImpActivityTest extends ActivityUnitTestCase&lt;R14ErrorImpActivity&gt; {    
    public R14ErrorLibImpActivityTest() {
        super(R14ErrorImpActivity.class);
    }       
    private static final int ANSWER_TO_THE_ULTIMATE_QUESTION_OF_LIFE_THE_UNIVERSE_AND_EVERYTHING = 42;    
    public void testTest() {
        assertEquals(ANSWER_TO_THE_ULTIMATE_QUESTION_OF_LIFE_THE_UNIVERSE_AND_EVERYTHING, 42);
    }       
}
</code></pre>

<p>Error:</p>

<pre><code>The type com.r14.error.lib.R14ErrorLibActivity cannot be resolved. It is indirectly referenced from required .class files
</code></pre>

<p>If the lib is added manually <a href="http://kyleclegg.com/eclipse-android-error-type-cannot-be-resolved/" rel="nofollow">1</a> (action not necessary in older adt versions) the build error is not displayed but the test fail with:</p>

<pre><code>java.lang.RuntimeException: Exception during suite construction
at android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests.testSuiteConstructionFailed(TestSuiteBuilder.java:239)
at java.lang.reflect.Method.invokeNative(Native Method)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:430)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)
Caused by: java.lang.reflect.InvocationTargetException
at com.r14.error.imp.test.R14ErrorLibImpActivityTest.&lt;init&gt;(R14ErrorLibImpActivityTest.java:10)
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
at android.test.suitebuilder.TestMethod.instantiateTest(TestMethod.java:87)
at android.test.suitebuilder.TestMethod.createTest(TestMethod.java:73)
at android.test.suitebuilder.TestSuiteBuilder.addTest(TestSuiteBuilder.java:263)
at android.test.suitebuilder.TestSuiteBuilder.build(TestSuiteBuilder.java:185)
at android.test.InstrumentationTestRunner.onCreate(InstrumentationTestRunner.java:336)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3982)
at android.app.ActivityThread.access$2900(ActivityThread.java:119)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1901)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4363)
at java.lang.reflect.Method.invokeNative(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NoClassDefFoundError: com.r14.error.imp.R14ErrorImpActivity
... 19 more
</code></pre>

<p>I'm working with Eclipse Indigo and ADT 15.</p>

<p>Thanks for any help!</p>
