1

我收到以下构建错误:

**** 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 文件夹中,我有什么选择?提前致谢。

4

1 回答 1

0

Skia 不是 NDK 的一部分,这就是缺少 SkCanvas.h 的原因。从您的 Android.mk 来看,您需要使用完整的 Android 树构建“您的共享库”。这可能是可能的,但由于没有库提供稳定的 API,因此无法保证您构建的内容将与不同的 Android 版本兼容(因为您使用的是共享库)。

于 2012-11-09T20:44:01.207 回答