- Home /
Error when using a NDK built Library which depend on another one in a Unity project
I want to create a native C++ program and use it on Android and I learned to do so using the Android NDK. I've even created a test plugin (lib*.so ) which worked perfectly. But when I created a plugin which depend on the first one (meaning another shared library created with the NDK) and used it in a Unity project, it didn't work. I've got this error :
E/Unity ( 4719): Unable to find MyLib
I/Unity ( 4719): DllNotFoundException: MyLib
I/Unity ( 4719): at (wrapper managed-to-native) TestDLLScript:Foo ()
I/Unity ( 4719): at TestDLLScript.Start () [0x00000] in <filename unknown>:0
I/Unity ( 4719):
I/Unity ( 4719): (Filename: Line: -1)
I/Unity ( 4719):
Is this a problem from Unity or is there some procedure that I need to follow to make this work?
Also here is my plugin make file, even though I don't think that the problem came from it (since it built without any error or warning) :
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := TestDLL
LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/libTestDLL.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/source
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := MyLib
LOCAL_SRC_FILES += MyLibrary.cpp
LOCAL_SHARED_LIBRARIES += TestDLL
include $(BUILD_SHARED_LIBRARY)
Your answer
Follow this Question
Related Questions
Importing Multiple Unity Project as a library inside Android Project 2 Answers
Android native plugin question 1 Answer
Pure Data (Pd) + Android + Unity integration? 2 Answers
Normal map is not working with Unity 5 when Low-level Native Plugin Interface is used 0 Answers
Android Unity, Screen Recording and MediaProjection APIs - UnityPlayerActivity hang. 0 Answers