Android ndk-build 失败并出现 dyld 错误

发布于 2025-01-07 05:11:38 字数 1431 浏览 0 评论 0原文

我正在执行以下教程 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

臻嫒无言 2025-01-14 05:11:38
Please look at this links.it may be helpfull..
http://psrdotcom.blogspot.in/2011/12/android-ndk-jni-windows-xp7-with-3264.html#!http://psrdotcom.blogspot.com/2011/12/android-ndk-jni-windows-xp7-with-3264.html
http://marakana.com/forums/android/examples/49.html
http://mindtherobot.com/blog/452/android-beginners-ndk-setup-step-by-step/
Please look at this links.it may be helpfull..
http://psrdotcom.blogspot.in/2011/12/android-ndk-jni-windows-xp7-with-3264.html#!http://psrdotcom.blogspot.com/2011/12/android-ndk-jni-windows-xp7-with-3264.html
http://marakana.com/forums/android/examples/49.html
http://mindtherobot.com/blog/452/android-beginners-ndk-setup-step-by-step/
枉心 2025-01-14 05:11:38

您需要降级到 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文