Search code examples
androideclipseandroid-source

Android on Eclipse Follow the right Android source code version while debugging


I am debugging an application with target android-17 (min version android-11).
The emulator I use has android 4.0.4, which is android-14 or android-15.

When I trace into android source methods, the debugger takes me to the android-17 source which is not the same as android-14 source code, so I end up following wrong code.

The project skeleton was created by Eclipse, back then when I chose "New Android Project". It has a folder with the android-17 code (Android 4.2), probably because the target version says so. But the compiled app runs on android-14 AVD emulator.

How can I follow the debugger into the right android source code?


Solution

  • It is not the target android version that you should look for, it is the project build target.

    To change that, select your project from the package explorer in Eclipse, and then either right click and select properties or Project from the menu bar and select properties.

    The properties window of your project will open, select Android and you should see something similar to this :

    project android properties

    From that window, select which android version you would like to compile your project with. Moreover, you have selected the project build target during the project wizard creation (it asks for the target version, build version (referred to as 'compile with') and minimum version).