我收到以下构建错误:
**** Build of configuration Default for project MyPlugin ****
D:\android-ndk-r8b-windows\android-ndk-r8b\ndk-build.cmd all
"Compile++ thumb : sampleplugin <= main.cpp
In file included from jni/animation/AnimationThread.h:25:0,
from jni/animation/AnimationPlugin.h:27,
from jni/main.cpp:31:
jni/RenderingThread.h:26:22: fatal error: SkCanvas.h: No such file or directory
compilation terminated.
make: *** [obj/local/armeabi/objs/sampleplugin/main.o] Error 1
**** Build Finished ****
这是我的Android.mk文件:
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
main.cpp \
PluginObject.cpp \
RenderingThread.cpp \
animation/AnimationPlugin.cpp \
animation/AnimationThread.cpp \
audio/AudioPlugin.cpp \
background/BackgroundPlugin.cpp \
form/FormPlugin.cpp \
navigation/NavigationPlugin.cpp \
paint/PaintPlugin.cpp \
video/VideoPlugin.cpp \
jni-bridge.cpp \
WEBCORE_PATH := external/webkit/Source/WebCore
LOCAL_C_INCLUDES += \
$(JNI_H_INCLUDE) \
$(LOCAL_PATH) \
$(LOCAL_PATH)/animation \
$(LOCAL_PATH)/audio \
$(LOCAL_PATH)/background \
$(LOCAL_PATH)/form \
$(LOCAL_PATH)/navigation \
$(LOCAL_PATH)/paint \
$(LOCAL_PATH)/nspluginwrapper \
$(LOCAL_PATH)/video \
$(WEBCORE_PATH)/bridge \
$(WEBCORE_PATH)/plugins \
$(WEBCORE_PATH)/platform/android/JavaVM \
external/webkit/Source/WebKit/android/plugins \
external/skia/include/core
LOCAL_SHARED_LIBRARIES := \
libnativehelper \
libandroid \
libutils \
libcutils \
libEGL \
libGLESv2 \
libskia
LOCAL_CFLAGS += -fvisibility=hidden
LOCAL_MODULE:= libsampleplugin
LOCAL_MODULE_TAGS := optional
include $(BUILD_SHARED_LIBRARY)
似乎所有需要的路径都在android.mk中指定,并且没有将每个头文件复制到源jni文件夹中,我有哪些选择?提前谢谢。
答案 0 :(得分:0)
Skia不是NDK的一部分,这就是为什么缺少SkCanvas.h的原因。从您的Android.mk来看,您需要使用完整的Android树构建“您的共享库”。它可能是可能的,但由于没有库提供稳定的API,因此无法保证您构建的内容与不同的Android版本兼容(因为您使用的是共享库)。