title: Android Studio native breakpoints not being hit
body: <p>I have a large Android project with lots of native and Java code. The Java code debugs fine. All breakpoints are being hit.</p>
  
  <p>The native debugger connects, but breakpoints are never hit. I am using ndk-build.</p>
  
  <p>In my gradle file I have declared the following:</p>
  
  <pre><code>buildTypes {
      release {
          minifyEnabled true
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
          debuggable false
          jniDebuggable false
      }
      debug {
          debuggable true
          jniDebuggable true
          minifyEnabled false
          packagingOptions{
              doNotStrip "*/armeabi-v7a/*.so"
              doNotStrip "*/arm64-v8a/*.so"
              doNotStrip "*/x86/*.so"
              doNotStrip "*/x86_64/*.so"
          }
      }
  }
  externalNativeBuild {
      ndkBuild {
          path 'src/main/jni/Android.mk'
      }
  }
  </code></pre>
  
  <p>Where I have declared my native function in Java, they show up red with the error "Cannot Resolve Corresponding JNI Function"</p>
  
  <p>I have followed every step of this post:
  <a href="https://stackoverflow.com/questions/42914167/cannot-resolve-corresponding-jni-function-android-studio">&quot; Cannot Resolve Corresponding JNI Function&quot; Android Studio</a> </p>
  
  <p>The project builds and runs fine, yet the native functions are not recognized in Java.</p>
  
  <p>One thing I noticed is that there is no armeabi-v7a folder in <code>obj\local\</code></p>
  
  <p>But there are armeabi-v7a folders in</p>
  
  <pre><code>build\intermediates\transforms\stripDebugSymbol\release\0\lib
  build\intermediates\transforms\mergeJniLibs\release\0\lib
  build\intermediates\ndkBuild\release\obj\local
  build\intermediates\ndkBuild\debug\obj\local
  .externalNativeBuild\ndkBuild\release
  .externalNativeBuild\ndkBuild\debug
  </code></pre>
  
  <p>Are there any other obscure settings that might disable native debugging?</p>
  
  <p>EDIT:</p>
  
  <p>This is how I declare my native functions in Java (BaseActivity.java):</p>
  
  <pre><code>native boolean SetupProject ();
  </code></pre>
  
  <p>This is how I declare them in C++:</p>
  
  <pre><code>JNIEXPORT jboolean JNICALL Java_com_mycompany_myapp_BaseActivity_SetupProject(JNIEnv * env, jobject obj) {
      //some code
      return JNI_TRUE;
  }
  </code></pre>
  
  <p>EDIT2:</p>
  
  <p>Library load:</p>
  
  <pre><code>static {
      try { 
          System.loadLibrary("myapp");                                                        
      } catch( UnsatisfiedLinkError e ) {
           Log.e("MyApp", "Native code library failed to load: " + e);
       }
  }
  </code></pre>
  
  <p>Android.mk:</p>
  
  <pre><code>LOCAL_PATH := $(call my-dir)
  MY_LOCAL_PATH := $(LOCAL_PATH)
  include $(CLEAR_VARS)
  LOCAL_MODULE := myapp
  
  FILE_LIST_APP := $(wildcard $(LOCAL_PATH)/App/*.cpp)
  LOCAL_SRC_FILES += $(FILE_LIST_APP:$(LOCAL_PATH)/%=%)
  LOCAL_C_INCLUDES := $(LOCAL_PATH)/App
  
  LOCAL_SHORT_COMMANDS := true
  APP_SHORT_COMMANDS := true
  
  LOCAL_CFLAGS    := -O0 -Wno-error -fshort-wchar -fpermissive -g -ggdb -ffast-math
  
  LOCAL_LDLIBS    := -lm -llog -ljnigraphics -ldl
  LOCAL_LDLIBS    += -L$(SYSROOT)/usr/lib -ldl
  LOCAL_LDLIBS    += -L$(SYSROOT)/usr/lib -lz
  LOCAL_LDLIBS    += -landroid
  
  
  include $(BUILD_SHARED_LIBRARY)
  </code></pre>
  
  <p>Application.mk:</p>
  
  <pre><code>APP_PLATFORM := android-25
  APP_CFLAGS += -Wno-error=format-security
  
  APP_OPTIM   :=   debug
  
  APP_STL     := gnustl_static 
  </code></pre>