Android ndk-build 失败并出现 dyld 错误
我正在执行以下教程 http://mobile.tutsplus.com/tutorials/android /ndk-教程/。
而且我似乎无法正确编译。我收到以下错误:
dyld: unknown required load command 0x80000022
dyld: unknown required load command 0x80000022
Compile thumb : ndk1 <= native.c
dyld: unknown required load command 0x80000022
make: *** [obj/local/armeabi/objs/ndk1/native.o] Trace/BPT trap
我运行的是 Mac OS X 10.5.8。我正在使用 Gnu Make 3.81。我正在使用 mac os x 附带的 awk。我正在使用 android ndk r7b。
dyld 错误似乎是在为 10.6 编译的大量代码中弹出的,然后在 10.5.8 机器上尝试。
Android.mk make 文件:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_LDLIBS := -llog
LOCAL_MODULE := ndk1
LOCAL_SRC_FILES := native.c
include $(BUILD_SHARED_LIBRARY)
native.c 文件:
#include <jni.h>
#include <string.h>
#include <android/log.h>
#define DEBUG_TAG "NDK_NDKtestActivity"
void Java_my_mumbo_jumbo_NDKtestActivity_helloLog(JNIEnv * env, jobject this, j\
string logThis)
{
jboolean isCopy;
const char * szLogThis = (*env)->GetStringUTFChars(env, logThis, &isCopy);
__android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "NDK:LC: [%s]", szLogThis);
(*env)->ReleaseStringUTFChars(env, logThis, szLogThis);
}
我的路径中可能没有包含 android 库吗?我只将 android r7b 文件夹添加到我的路径中,以便我可以找到 ndk-build?
谢谢, 托马斯
I'm doing the following tutorial http://mobile.tutsplus.com/tutorials/android/ndk-tutorial/.
And I can't seem to compile properly. I get the following error:
dyld: unknown required load command 0x80000022
dyld: unknown required load command 0x80000022
Compile thumb : ndk1 <= native.c
dyld: unknown required load command 0x80000022
make: *** [obj/local/armeabi/objs/ndk1/native.o] Trace/BPT trap
I'm running Mac OS X 10.5.8. I'm using Gnu Make 3.81. I'm using the awk that ships with mac os x. And I'm using android ndk r7b.
The dyld error seems to pop up with a lot of code compiled for 10.6 and then tried on a 10.5.8 machine.
Android.mk make file:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_LDLIBS := -llog
LOCAL_MODULE := ndk1
LOCAL_SRC_FILES := native.c
include $(BUILD_SHARED_LIBRARY)
native.c file:
#include <jni.h>
#include <string.h>
#include <android/log.h>
#define DEBUG_TAG "NDK_NDKtestActivity"
void Java_my_mumbo_jumbo_NDKtestActivity_helloLog(JNIEnv * env, jobject this, j\
string logThis)
{
jboolean isCopy;
const char * szLogThis = (*env)->GetStringUTFChars(env, logThis, &isCopy);
__android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "NDK:LC: [%s]", szLogThis);
(*env)->ReleaseStringUTFChars(env, logThis, szLogThis);
}
Am I not including an android library in my path possibly? I've only added the android r7b folder to my path so i could find ndk-build?
Thanks,
Thomas
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要降级到 NDK 6b,如下所示:
https://ar.qualcomm.at/arforums/showthread.php?t=1590瓦茨拉夫
You need to downgrade to NDK 6b as shown here:
https://ar.qualcomm.at/arforums/showthread.php?t=1590
Vaclav