Search Unity

Problem when using a ndk builded library who depend from another one

Discussion in 'Android' started by tictacf12, Jul 18, 2016.

  1. tictacf12

    tictacf12

    Joined:
    Aug 23, 2015
    Posts:
    2
    Hello,

    I want to create a natve c++ and use it on android and i learned to do so using android NDK. I've even created a test plugin (lib*.so ) who worked perfectly. But when i created a plugin who depend from the first one (meaning another shared librry create with ndk ) and used it in a unity project, it didn't work i've got this error :

    Code (CSharp):
    1. E/Unity   ( 4719): Unable to find MyLib
    2. I/Unity   ( 4719): DllNotFoundException: MyLib
    3. I/Unity   ( 4719):   at (wrapper managed-to-native) TestDLLScript:Foo ()
    4. I/Unity   ( 4719):   at TestDLLScript.Start () [0x00000] in <filename unknown>:0
    5. I/Unity   ( 4719):
    6. I/Unity   ( 4719): (Filename:  Line: -1)
    7. I/Unity   ( 4719):
    Is this a problem from unity or is there some procedure that i need to do to make this work?

    Also there is my plugin make file, even i dont think that the problem came from it (since it got builded without any error or warning )

    Code (CSharp):
    1. LOCAL_PATH := $(call my-dir)
    2.  
    3. include $(CLEAR_VARS)
    4. LOCAL_MODULE := TestDLL
    5. LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/libTestDLL.so
    6. LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/source
    7. include $(PREBUILT_SHARED_LIBRARY)
    8.  
    9. include $(CLEAR_VARS)
    10. LOCAL_MODULE := MyLib
    11. LOCAL_SRC_FILES += MyLibrary.cpp
    12. LOCAL_SHARED_LIBRARIES += TestDLL
    13. include $(BUILD_SHARED_LIBRARY)
     
  2. Zenix

    Zenix

    Joined:
    Nov 9, 2009
    Posts:
    213
    Bumping this for you as I recently ran into the same issue and couldn't find an answer...
     
  3. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Circular dependency maybe?

    Not sure what else could cause that error.