DllNotFoundException in unity3d plugin for c++ dll

后端 未结 7 1495
死守一世寂寞
死守一世寂寞 2021-01-11 17:49

I am working on the Unity Plugin project and try to import the c++ native dll from c# file. But I keep getting dllnotfoundexception.

c++ dll code:

7条回答
  •  北海茫月
    2021-01-11 18:30

    In my case, I have DllNotFoundException: ovrplatiformloader

     Unity   : DllNotFoundException: ovrplatformloader
     Unity   :   at (wrapper managed-to-native) Oculus.Platform.CAPI.ovr_UnityInitWrapperAsynchronous(string)
     Unity   :   at Oculus.Platform.AndroidPlatform.AsyncInitialize (System.String appId) [0x00013] in <29065e843b82403894fca6c6f2974090>:0 
     Unity   :   at Oculus.Platform.Core.AsyncInitialize (System.String appId) [0x0004f] in <29065e843b82403894fca6c6f2974090>:0 
     Unity   :   at DBHelper.Start () [0x00019] in <29065e843b82403894fca6c6f2974090>:0 
    

    My solution is:

    1. Re-import files that doesn't work (libovrplatformloader.so)
    2. Reconstruct the Platform/Plugins architecture. Old: Platform/Plugins/Android32/libovrplatformloader.so. New: Platform/Plugins/Android/x86/libovrplatformloader.so and Platform/Plugins/Android/armeabi-v7a/libovrplatformloader.so
    3. Modify the import setting of libovrplatformloader.so. Change any platform to only Android platform and enable 'load on startup' selection. Choose ARMv7 CPU in armeabit-v7a while choose x86 CPU in x86 folder.

提交回复
热议问题