Question

I get the following build error:

**** 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 ****

This is my Android.mk file:

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)

It seems every path needed is specified in the android.mk, and short of copying every header ever into the source jni folder, what are my options? Thanks in advance.

Was it helpful?

Solution

Skia is not part of NDK which is the reason why SkCanvas.h is missing. Judging from your Android.mk you need to build 'your shared library' with a full Android tree. It might be possible but since non of the libraries offer a stable API there is no guarantee that what you build will be compatible with different Android versions (since you are using shared libraries).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top