Android NDK无法使用两个渐变插件调试本机代码 [英] Android NDK unable to debug native code with two gradle plugins

查看:164
本文介绍了Android NDK无法使用两个渐变插件调试本机代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用NDK与实验的gradle插件,最初我能够调试我的本地代码。



然后我看到这个问题


I'm using NDK with the experimental gradle plugin, and initially I was able to debug my native code.

Then I saw this issue https://github.com/googlesamples/android-ndk/issues/119 and this blog post http://frogermcs.github.io/json-parsing-with-flatbuffers-in-android/. This approach would be great, because I could use the stable gradle plugin for android specific code, and the experimental gradle plugin for the native code, witch would be great to use use databinding for example. I was able to use this structure, but I lost the ability to debug native code.

I have created a sample project that illustrate my problem. https://github.com/4brunu/AndroidNDKDebug

In there you can find two projects. The first one "hello-jni-one-gradle-plugin", only use the experimental gradle plugin, and I'm able to debug the native code. The second one "hello-jni-two-gradle-plugins", I use the stable gradle plugin for android specific code, and the experimental gradle plugin for the native code, and I'm unable to debug the native code.

Am I doing something wrong? Could you help me enable native code debug in the second project please?

Thanks

解决方案

I'm using the same setup in one of my projects, with Android Studio 2.1-preview5, gradle-experimental 0.7.0-alpha5, and gradle plugin 2.1.0-alpha5, and debugging works.

The secret missing step is to add the path to your non-stripped libs to the debugger: lib/build/intermediates/binaries/release/obj/ABI

这篇关于Android NDK无法使用两个渐变插件调试本机代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆