title: Breakpoints in native codes cannot be hit on Android Studio
body: <p>I am recently working on android native libraries development, required to be familiar with Android Studio. Via this <a href="https://github.com/android/ndk-samples/tree/master/hello-gl2/" rel="nofollow noreferrer">sample</a>, I learned something fundamental about ndk and jni routine. However, I am stuck on debugging native codes of this sample. Particularly, ndk's debugger works fine for emulator(Nexus 5X API 29 x86) while break points in native codes cannot be hit for real devices(HUAWEI P9, android Oreo). Besides, break points in java codes worked fine for real devices.</p>
  <p>app's gradle script is as follows:</p>
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 29
      ndkVersion '21.2.6472646'
      
      defaultConfig {
          applicationId 'com.android.gl2jni'
          minSdkVersion 14
          targetSdkVersion 28
          externalNativeBuild {
              cmake {
                  // Available arguments are inside ${SDK}/cmake/.../android.toolchain.cmake file
                  arguments '-DANDROID_STL=c++_static'
              }
          }
      }
  
      buildTypes {
          release {
              minifyEnabled = false
              proguardFiles getDefaultProguardFile('proguard-android.txt'),
                            'proguard-rules.pro'
          }
      }
      externalNativeBuild {
          cmake {
              version '3.10.2'
              path 'src/main/cpp/CMakeLists.txt'
          }
      }
  }
  </code></pre>
  <p><strong>Other Details</strong>:
  Using &quot;Analyze APK&quot; utility of Android Studio, I checked contents installed on my devices:<a href="https://i.stack.imgur.com/htYDx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/htYDx.png" alt="enter image description here" /></a>
  Then I found a bigger lib placed on <code>${project root}/app/build/intermediates/cmake/debug/obj/arm64-v8a</code>:
  <a href="https://i.stack.imgur.com/eQ4ZB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eQ4ZB.png" alt="enter image description here" /></a>
  It seemed debugging symbols of native lib within the APK were stripped, And android studio didn't pack proper native lib for debugging?</p>