Search code examples
androidgradlendk-gdb

ndk-gdb with gradle flavor


In my android project I have a default flavor with a default package name for example:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.my.default"
android:installLocation="auto">

And in my build.gradle I've added another flavor with a different package name:

productFlavors {
    another {
        applicationId 'com.my.another'  // This could override the package name defines in the `AndroidManifest.xml`
    }
}

After the APK has been installed into my device I want to attach the ndk-gdb and I get such issues:

  1. If I install the com.my.default everything is fine.
  2. If I install the com.my.another, the ndk-gdb fails because it was looking for the com.my.default which defines in the AndroidManifest.xml.
  3. If I change the package name in the AndroidManifest.xml to com.my.another manually then ndk-gdb works.

And my question: Is there any way I could use ndk-debug to debug a flavor produced APK without altering the AndroidManifest.xml?


Solution

  • Android fixed this issue in the latest ndk-r10e https://code.google.com/p/android/issues/detail?id=56189