Application is waiting for debugger

By : Jacob
Source: Stackoverflow.com
Question!

I know this has been mentioned many times, but I've noticed strange thing that were not talked before. In fact, when the app get deployed on device, even we disconnect device from pc and restart the phone the app will still show this message "Waiting For Debugger".

When we plug in to the pc, and attach debugger in IDE, application start running normally. The same is when we disconnect debugger --> app, popup the black screen and "Waiting For Debugger". We can iterate this to infinity.

It looks as if there were some dependency to debugger.

Activity that is set as launcher in manifest:

<activity
        android:name=".activities.SplashScreenActivity"
        android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

Project buildscript:

buildscript {
    repositories {
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.14.4'

    }
}

app module buildscript:

apply plugin: 'android'
android {
    compileSdkVersion 21
    buildToolsVersion "21.1.1"

    defaultConfig {
        applicationId "com.dot42"
        minSdkVersion 14
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile project(':deviceList')
    }
}

library module buildscript:

apply plugin: 'com.android.library'

android {
    compileSdkVersion 'Google Inc.:Google APIs:21'
    buildToolsVersion "21.1.1"

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 21

    }

}

dependencies {
    compile 'com.android.support:support-v4:21.0.2'
}

Any ideas?

By : Jacob


Answers

Go to Settings > Developer Options In Debugging section make sure "Select debug app" is not set for your application, along with "Wait for debugger" options checked. If so this is expected behaviours since Debugged application waits for debugger to attach before executing.

By : Nova


This video can help you solving your question :)
By: admin