Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid Activity under Eclipse/ADT with Project Dependencies (Failed resolving XY)
    text
    copied!<p>I tried to keep a game project quite platform independent so I split it up into <strong>three projects</strong> from low-level to top android specific level like that: engine, game, android game.</p> <p>The involved classes/interfaces in the error are those:</p> <ol> <li><p>(low level) engine project defines this interface:</p> <pre><code>com.myteam.engine.IGame </code></pre></li> <li><p>(mid level) platform independent game project defines those classes:</p> <pre><code>com.myteam.myproject.Game com.myteam.myproject.MyProject (derived from com.myteam.myproject.Game) </code></pre></li> <li><p>(top level) android project implements activity, etc.:</p> <pre><code>com.myteam.myproject.android.MyAndroidActivity (using com.myteam.myproject.MyProject) </code></pre></li> </ol> <p>All compiles well and runs perfectly under Windows (with another Windows project on level 3 using the first two).</p> <p>But when running with ADT it fails at run-time when the Activity starts. The Android app basically just displays a call stack with a "NoClassDefFoundError com.myteam.myproject.MyProject" exception.</p> <p>The exception seems to be caused by its super class (or the super class' interface) while loading/resolving as the LogCat output reveals:</p> <pre><code>12-20 19:51:51.897: D/ddm-heap(218): Got feature list request 12-20 19:51:52.207: I/dalvikvm(218): Failed resolving Lcom/myteam/myproject/Game; interface 18 'Lcom/myteam/engine/IGame;' 12-20 19:51:52.217: W/dalvikvm(218): Link of class 'Lcom/myteam/myproject/Game;' failed 12-20 19:51:52.227: W/dalvikvm(218): Unable to resolve superclass of Lcom/myteam/myproject/MyProject; (52) 12-20 19:51:52.227: W/dalvikvm(218): Link of class 'Lcom/myteam/myproject/MyProject;' failed 12-20 19:51:52.227: E/dalvikvm(218): Could not find class 'com.myteam.myproject.MyProject', referenced from method com.myteam.myproject.android.MyAndroidActivity.onCreate 12-20 19:51:52.227: W/dalvikvm(218): VFY: unable to resolve new-instance 54 (Lcom/myteam/myproject/MyProject;) in Lcom/myteam/myproject/android/Youcode_AndroidActivity; 12-20 19:51:52.227: D/dalvikvm(218): VFY: replacing opcode 0x22 at 0x0008 12-20 19:51:52.227: D/dalvikvm(218): Making a copy of Lcom/myteam/myproject/android/Youcode_AndroidActivity;.onCreate code (88 bytes) </code></pre> <p>I tried adding the two first projects under the "Build Path / Order and Export" Eclipse project settings of the android game project as described in other posts and forums but it doesn't change a thing.</p> <p>My hunch is that the Manifest or Project settings need another mentioning of the package/class dependencies for apk packaging or run-time. Any ideas?</p>
 

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