在Android上安装prebuilt二进制:"未发现" [英] Installing a prebuilt binary on Android: "not found"

查看:255
本文介绍了在Android上安装prebuilt二进制:"未发现"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图安装一个prebuilt二进制在定制的Andr​​oid图像。对于我已经把它复制到一个新的目录 prebuilt /机器人臂/ Android.mk 文件与此类似:

I'm trying to install a prebuilt binary in a custom Android image. For that I have copied it to a new directory in prebuilt/android-arm/ with an Android.mk file similar to this one:

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_SRC_FILES := binary_name
LOCAL_MODULE := binary_name
LOCAL_MODULE_CLASS := EXECUTABLES
include $(BUILD_PREBUILT)

所以,如果我跑使system_image binary_name ,二进制文件复制到 /斌/ 系统映像。如果我运行模拟器,我可以看到在二进制文件 /系统/斌。权限是一样的其他可执行文件( -rwxr-XR-X ),并根据文件,这是一个ARM二进制文件( ELF 32位LSB的可执行文件,ARM,版本1(SYSV),动态链接(使用共享库),剥离)。

So if I run make system_image binary_name, the binary file is copied to /bin/ in system image. And if I run the emulator I can see the binary file in /system/bin. The permissions are the same as the other executables (-rwxr-xr-x) and, according to file, this is an ARM binary (ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), stripped).

但是,当我在模拟器上运行它,它说:

But when I run it on the emulator, it says:

# binary_name
binary_name: not found

我已经straced它,这是我所看到的:

I have straced it and this is what I can see:

# strace binary_name
execve("/system/bin/binary_name", ["binary_name"], [/* 9 vars */]) = -1 ENOENT (No such file or directory)
write(2, "strace: exec", 12strace: exec)            = 12
write(2, ": ", 2: )                       = 2
write(2, "No such file or directory", 25No such file or directory) = 25
write(2, "\n", 1
)                       = 1
io_submit(1, -1344063348, {...} <unfinished ... exit status 1>

不过,该文件是存在的,并且strace是能够找到它。

But the file is there, and strace is able to find it.

什么可以发生任何想法?

Any idea of what can be happening?

更新:由于克里斯托夫说,这可能是动态链接的问题,但我没有LDD为Android ARM ...

UPDATE: As Kristof says, this is probably a problem of dynamic linking, but I don't have ldd for Android ARM...

推荐答案

也许有些所需的动态库无法找到。

Perhaps some of the required dynamic libraries can't be found.

尝试LDD binary_name

Try 'ldd binary_name'

应该看起来有点像这个,如果所有的图书馆都可以找到的输出。 缺少库应有明显的标志。

The output should look a little like this if all libraries can be found. Missing libraries should be clearly marked.

linux-gate.so.1 =>  (0xb7fbf000)
libcap.so.2 => /lib/libcap.so.2 (0xb7fa7000)
libdl.so.2 => /lib/i686/cmov/libdl.so.2 (0xb7fa3000)
libncursesw.so.5 => /lib/libncursesw.so.5 (0xb7f64000)
libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb7f3e000)
libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7dde000)
libattr.so.1 => /lib/libattr.so.1 (0xb7dd9000)
/lib/ld-linux.so.2 (0xb7fc0000)

这篇关于在Android上安装prebuilt二进制:&QUOT;未发现&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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