不能调试Android原生code建立在Eclipse的Andr​​oid的库 [英] Cannot debug android native code built on android library on eclipse

查看:119
本文介绍了不能调试Android原生code建立在Eclipse的Andr​​oid的库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

结果
我一直在挣扎与此3天,我无法完成它。结果
我有一个链接到一个机器人库,包含本地code,在Eclipse上的Andr​​oid项目。结果
我看到这个问题,这是相同的架构矿山,但步骤提出就不会工作。


I have been struggling with this for 3 days and I could not get it done.
I have an android project that links to an android library, containing native code, on eclipse.
I saw this question, which is the same schema as mine, but the steps proposed there would not work.

我这里重写的步骤,分别是:

I rewrite the steps here, which are:


  1. 进入运行菜单 - >调试配置

  2. 在左窗格中的Android原生应用程序,选择您的应用程序

  3. 在调试选项卡中单击添加...共享库部分。

  4. 浏览到您的Andr​​oid库项目目录,并添加它的子目录OBJ /本地/ armeabi。

  5. 应用和调试。

第一个问题是,我不能设置调试配置的本机应用程序,如果应用程序没有设置为本地(只链接到本机应用程序),所以我不能选择任何项目调试。

First problem was, I could not set up Debug config for native app if the application is not set up as native, (only links to a native app), so I cannot select any project to debug.

我尝试设置Android应用程序项目具有C / C ++的性质,用假JNI / Android.mk,因为只是没有显示在构建任何错误。 (我怀疑这是正确的道路要走,虽然)结果
该应用程序然后运行和链接正确,我能够按照这些步骤--1到5但当我调试它,控制台显示(BasicCharacterWithLib是应用程序的名称):

I tried setting the android app project as having c/c++ nature, with dummy jni/Android.mk, as just not showing any error on build. (I doubt this is the right way to go, though)
The app then runs and links correctly, and I am able to follow those steps --1 to 5. But as I debug it, the console shows (BasicCharacterWithLib is the name of the app):

[2014-05-27 12:18:09 - BasicCharacterWithLib] Error while obtaining file from device
[2014-05-27 12:18:09 - BasicCharacterWithLib] com.android.ddmlib.SyncException: Writing local file failed!

和它永远不会停止在任何断点(本机或不)

And it would never stop on any breakpoint (native or not)

我也知道的<一个href=\"http://stackoverflow.com/questions/17317133/debugging-android-native-application-using-ndk-gdb\">this另一个问题,具有在不同的配置相同的症状(直接执行的应用程序),但它仍然没有答案。

I am also aware of this other question, having the same symptoms on a different configuration (directly executing an app), but it remains unanswered.

我已经成功调试另一个应用程序在同一设备中,具有里面本土code测试的应用程序,所以我想这个问题不能归因于设备的配置。

I have successfully debugged another app in the same device, a test app having native code inside it, so I guess the problem cannot be due to the device config.

你知道如何解决呢?

一些进一步的细节:


  • 我使用的Eclipse ADT的包(版本v22.6.2,SDK中提供最高API级别19和NDK版本R9)

  • 该应用程序在多个线程(通过的AsyncTask从Java执行)运行,但在这一点上只有主线程启动。结果

  • 调试过程中只在Java方面,如果我调试它作为一个Android应用程序,即使是在多线程工作。

  • 我已经设置为APP_PLATFORM Android的14 Application.mk,相同清单的minSdkVersion =14。

  • 我也试过重新启动Eclipse中,重新启动设备,并拔出并重新插上USB。

推荐答案

请参阅此<一个href=\"http://stackoverflow.com/questions/17317133/debugging-android-native-application-using-ndk-gdb/24792906#24792906\">question.可能它可能是不存在磁盘上的obj /本地/ armeabi 文件夹的同样的问题。

See this question. Likely it could be the same issue of the obj/local/armeabi folder not existing on disk.

这篇关于不能调试Android原生code建立在Eclipse的Andr​​oid的库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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