0

When using an Emulator with Android Studio I am able to step through the C++.

Once I start running this on a real device I am able to break inside the Java but not in any of the native code.

I am using Android Studio 3.2.1 and building for SdkVersion 28 and min SDK 22. I running on a 5.1 emulator.

Here is my build.grable (App)

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.ash_eng.www.contordroid"
        minSdkVersion 22
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        externalNativeBuild {
            cmake {
                cppFlags ""
            }
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    externalNativeBuild {
        cmake {
            path "CMakeLists.txt"
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }


}

The real hardware I am using is a Honor 9 running android 8.0.

Am I missing some configuration on the phone?

daedsidog
  • 1,732
  • 2
  • 17
  • 36
John Judd
  • 53
  • 5
  • 1
    Some devices don't let native debugger, unless rooted. This may be not your mistake, but a device bug. – Alex Cohn Dec 11 '18 at 14:41
  • 1
    I believe you are correct. Honor is a sub brand of Huawei and it is their policy to lock phones out of this. Found this SO thread about it: https://stackoverflow.com/questions/50096048/not-working-debug-mode-native-code-c-c-on-android-studio-with-tablet-huawe – John Judd Dec 11 '18 at 16:13

1 Answers1

2

Thanks to Alex's comment, NDK working now on a non-rooted LG G3 without any issues. It was an issue with Huawei / Honor locking out NDK debugging.

John Judd
  • 53
  • 5