简体   繁体   English

Android NDK构建失败,出现dyld错误

[英]Android ndk-build fails with dyld error

I'm doing the following tutorial http://mobile.tutsplus.com/tutorials/android/ndk-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. 我正在运行Mac OS X 10.5.8。 I'm using Gnu Make 3.81. 我正在使用Gnu Make 3.81。 I'm using the awk that ships with mac os x. 我正在使用Mac OS X随附的awk。 And I'm using android ndk r7b. 我正在使用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. dyld错误似乎弹出了很多为10.6编译的代码,然后在10.5.8机器上尝试了。

Android.mk make file: Android.mk制作文件:

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: 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);
}

Am I not including an android library in my path possibly? 我的路径中可能不包含android库吗? I've only added the android r7b folder to my path so i could find ndk-build? 我只将android r7b文件夹添加到了我的路径,以便可以找到ndk-build?

Thanks, Thomas 谢谢托马斯

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/

You need to downgrade to NDK 6b as shown here: https://ar.qualcomm.at/arforums/showthread.php?t=1590 您需要降级到NDK 6b,如下所示: https ://ar.qualcomm.at/arforums/showthread.php?t =1590

Vaclav 瓦茨拉夫

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM