Can't debug applications using OnePlus 2

917 Views Asked by At

I have a problem debugging applications using my new OnePlus 2. Once the debugging starts the application is blacked out and unresponsive. After some time the black screen disappears and I can see my app but it is unresponsive. The Android Development Studio shows it is still in debugging mode but obviously I am not stuck on a breakpoint. The application gets responsive only when I stop the debugging session from within the ADS.

My phone is a stock OnePlus 2 A2003 running Android 5.1.1, kernel 3.10.49 and Oxygen OS 2.1.1. The phone is detected by the ADB and is set to USB debugging mode. The same issue happens no matter the options I set in Developer settings section (choosing the app being debugged or changing 'do not attach debugger' option). Just running the application works without problems.

I am using the newest Android Development Studio version available. I should not have any other software communicating with the phone (never had Eclipse installed). Only one adb process is running. I work from Windows 10 64bit.

Restarting the phone, ADB, PC or ADS does not help.

The same application can be debugged with no problem by my HTC One M7 running Android 5.0.

Can you give me any hints to what may be causing the problem? I am a novice in Android app development.

This is the debug console log I have:

The session was restarted
Target device: oneplus-one_a2003-6b306066
Uploading file
    local path: D:\QuasarSpectrum\app\build\outputs\apk\app-debug.apk
    remote path: /data/local/tmp/com.kp.quasarspectrum
No apk changes detected.
Skipping file upload, force stopping package instead.
DEVICE SHELL COMMAND: am force-stop com.kp.quasarspectrum
Launching application: com.kp.quasarspectrum/com.kp.quasarspectrum.MainActivity.
DEVICE SHELL COMMAND: am start -D -n "com.kp.quasarspectrum/com.kp.quasarspectrum.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.kp.quasarspectrum/.MainActivity }

Warning: debug info can be unavailable. Please close other application using ADB: Monitor, DDMS, Eclipse
Waiting for process: com.kp.quasarspectrum
Connected to the target VM, address: 'localhost:8600', transport: 'socket'

This is the build.gradle file content:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "com.kp.quasarspectrum"
        minSdkVersion 21
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile 'com.android.support:appcompat-v7:23.0.+'
    compile files('libs/mpandroidchartlibrary-2-1-5.jar')
}

EDIT If anyone is curious, I have solved this issue by rooting the phone and switching to Cyanogenmod 13 (Android 6.0).

1

There are 1 best solutions below

0
On

Issue in my case was with the breakpoints, remove them all once and add them one by one to see if thats the issue...might also help if you run your debugging in camera mode.