Android Studio NDK系统错误中打开的文件过多

时间:2016-06-29 19:23:56

标签: android c++ android-ndk android.mk

目前正在为android ndk编译freetype库,但我收到此错误:

Android.mk:1: Android.mk: Too many open files in system
Android.mk:6: /Development/android-sdk-macosx/ndk-bundle/build/core/clear-vars.mk: Too many open files in system
Android.mk:22: /Development/android-sdk-macosx/ndk-bundle/build/core/build-shared-library.mk: Too many open files in system
/Development/android-sdk-macosx/ndk-bundle/build/core/build-shared-library.mk:34: /Development/android-sdk-macosx/ndk-bundle/build/core/build-module.mk: Too many open files in system

结构:

src/
    main/
        java/
        jni/
            freetype/
                include/
                src/
                Android.mk
                ...
            src/
                ...
            Android.mk
            Application.mk

JNI / Android.mk

include Android.mk
LOCAL_PATH := $(call my-dir)
# Project
include $(CLEAR_VARS)

LOCAL_MODULE := sanangeles
LOCAL_STATIC_LIBRARIES := freetype
LOCAL_LDLIBS := -landroid -lEGL -lGLESv2 -ldl -llog
LOCAL_CFLAGS := -DANDROID_NDK -DDISABLE_IMPORTGL
LOCAL_SRC_FILES := \
    src/Gantt.cpp \
    src/app.c \
    src/importgl.c \
    src/Helpers/ivec2.cpp \
    src/Helpers/vec3.cpp \
    src/Renderers/BoxRenderer.cpp \
    src/Renderers/TextRenderer.cpp \
    src/Renderers/Shader.cpp

include $(BUILD_SHARED_LIBRARY)

freetype的/ Android.mk

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

FREETYPE_SRC_PATH := $(LOCAL_PATH)/
$(info Freetype path: '$(FREETYPE_SRC_PATH)')
LOCAL_MODULE := freetype

LOCAL_CFLAGS := -DANDROID_NDK \
  -DFT2_BUILD_LIBRARY=1

LOCAL_C_INCLUDES := \
  $(FREETYPE_SRC_PATH)include \
  $(FREETYPE_SRC_PATH)src

LOCAL_SRC_FILES := \
 $(FREETYPE_SRC_PATH)src/autofit/autofit.c \
 $(FREETYPE_SRC_PATH)src/base/basepic.c \
 ...
 $(FREETYPE_SRC_PATH)src/lzw/ftlzw.c

LOCAL_LDLIBS := -ldl -llog

include $(BUILD_SHARED_LIBRARY)

编辑:

问题解决了,意外地递归添加了自己的文件,而不是正确的freetype/Android.mk。有人知道如何添加那个吗?

0 个答案:

没有答案