ndk-gdb 4.3 error(Could not extract package's data directory)

原创 2015年07月10日 21:45:37

1,这个地方有一个解决方案

http://www.drovik.com/html/3294084942.html

android开发过程中,在用eclipse的图形化工具调试c++程序的时候,报出了如下错误:

Could not extract package's data directory. Are you sure that your installed application is debuggable?

 

在AndroidManifest.xml文件中我已经设置debuggable选项为true, 可是还是报出如上的错误,造成生成app_process文件失败,就无法进行调试了。

 

解决这个问题需要修改ndk-gdb的脚本。

 

具体修改内容如下:

将“adb_var_shell2 DATA_DIR run-as $PACKAGE_NAME /system/bin/sh -c pwd”用DATA_DIR="/data/data/$PACKAGE_NAME" 替换,
 
重新执行ndk-gdb生成app_process文件。

接下来可以正常调试。

2,还有一个解决方案:

http://visualgdb.com/KB/?ProblemID=nopkg

This is a known bug of the Android platform. When you try to debug your NDK-based app, gdbserver fails to start and a message like below is shown:

run-as: Package 'com.android.gl2jni' is unknown

This happens due to two known bugs related to the run-as tool. The tool needs to read information about your app from the /data/system/packages.list file inside your Android device. In the case of the first bug, the tool is actually only reading the first 8KB of the file. Thus, if the line containing your app description is below the first 8 KB, run-as will fail. The second bug affects some 4.2.2 and 4.3 Android images by falsely restricting read rights of the packages.list file that contains all the package names.

8 Kilobyte Bug

Detection

  1. Retrieve the packages.list file by running the following command inside SDK\platform-tools:
    adb pull /data/system/packages.list
  2. If the file is larger than 8 kilobytes, your problem is caused by the 8 kilobyte bug.

Workarounds

There are three known workarounds  for this bug:

  1. Uninstall unnecessary apps from your Android device to reduce the size of the packages.list file
  2. Try renaming the app ID arbitrarily. The order of the lines inside packages.list depends on the hash value of the app ID. Thus changing the ID just a bit might put it within the first 8 KB.
  3. If your device is rooted, edit the packages.list file manually to put your app in front of the list.

Read Rights Bug

Detection

  1. Is your Nexus or Galaxy Android device using Android 4.2.2 or Android 4.3?
  2. Open Android shell. Change directory to "/data/system", run the command "ls -l". Are the access rights to packages.list "-rw-rw----" instead of "-rw-rw-r--" ? If yes, then your device's image is affected by the bug.

Workarounds

  1. Install the 4.3 factory image for the Android device manually. Do not install the mini 4.3 update after installing the image.
  2. If your device is rooted, change the read rights of the packages.list file.
  3. Add the set-uid bit to the run-as binary:
    su
    mount -o remount,rw /system
    chmod 4750 /system/bin/run-as
  4. Try other workarounds from the official bug thread.

版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

ERROR: Could not extract package's data directory. Are you sure that your installed application is d

ERROR: Could not extract package's data directory. Are you sure that your installed application is...

VC6.0 Could not execute: invalid directory (Win32 error 267)

Could not execute: invalid directory (Win32 error 267)   (2011-09-07 11:37:18) 转载▼ 标...

Could not execute: invalid directory (Win32 error 267)

一、 造成这个错误的原因主要是运行别人的程序时,设置不正确. 工程—>设置,问题出在右边“调试”标签的“工作目录”和你现在运行工程的目录不一致,如下图: not execute: invalid...

could not extract ResultSet

严重: Servlet.service() for servlet [spring] in context with path [] threw exception [Request processi...

org.hibernate.exception.SQLGrammarException: could not extract ResultSet

org.hibernate.exception.SQLGrammarException: could not extract ResultSet at org.hibernate.exception...

Linux 格式化分区 报错Could not stat --- No such file or directory 和 partprobe 命令

分区的过程正常:[root@db1 /]# fdisk -l Disk /dev/sda: 21.4 GB, 21474836480 bytes255 heads, 63 sectors/track,...

Linux 格式化分区 报错Could not stat --- No such file or directory 和 partprobe 命令

【原文链接】:http://blog.chinaunix.net/uid-26557245-id-3134302.html 分区的过程正常: [root@db1 /]# fdisk -l   ...

安装pnp4nagios时出现Pango-WARNING **: error opening config file '/home/www/.pangorc': Not a directory错误

公司要求搭建
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)