javaandroideclipsedebugginglaunching

Eclipse: Launching Debugging Mode for Android App often doesn´t work


When i want to debug my Android App (on an Emulator) the Debugger goes into Debugging Mode, but i cannot use the items of the toolbar (resume, terminate etc). The weird thing is that it´s not always like that: sometimes after hitting the relaunch button several times it starts and suddenly shows threads, runs through the code till the next breakpoint, shows values of variables and so on, so everything works fine. But often just nothing happens. It seems to start just randomly, which makes it impossible to work constantly. Searching for the issue didn´t bring me any solution. Can andybody help me?

Here´s the manifest File of my App:

?xml version="1.0" encoding="utf-8"?
manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.mobilecartography.tudresdenspeechorganiser"
    android:versionCode="1"
    android:versionName="1.0"

<uses-sdk
    android:minSdkVersion="14"
    android:targetSdkVersion="21" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >

    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" 
        >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>


Solution

  • I have this issue often. There are a few things you can try.

    1. Select your device in the DDMS perspective.
    2. Restart the ADB (adb kill-server from your command line\terminal then start it again. I usually just do adb devices...)
    3. Finally, if the previous two don't help, restart Eclipse. I know it sounds basic but sometimes it's all that's needed.

    Sometimes a combination of the three is needed to fix it for me.

    Hope this helps you out.