Question by
aleksey_tim · Sep 15, 2020 at 09:09 AM ·
dllnotfoundexception
ddlnotfound exception - what is the problem?
I faced weird issue - I have 2 lib that I put under Assets\Plugins\Android
, first lib name is mylibrary
and second one - libtetdecoder
.
Then I try to use them with the same way and I see that I can invoke methods from first one and can't from second one, because of this error
(Filename: <d25e5b88a8b44b89b27c70e01a22f338> Line: 0)
2020-09-15 09:39:53.243 26169-26207/? E/Unity: DllNotFoundException: libtetdecoder
at (wrapper managed-to-native) TestScript.foolib()
at TestScript.Update () [0x00021] in <d25e5b88a8b44b89b27c70e01a22f338>:0
There is how I use these libs:
using UnityEngine;
using System.Runtime.InteropServices;
using UnityEngine.UI;
using System.Globalization;
public class TestScript : MonoBehaviour
{
public Text myText;
public Text myText2;
private const string pluginNameFirst = "mylibrary";
private const string pluginNameSecond = "libtetdecoder";
//native interface
[DllImport(pluginNameFirst)]
private static extern int foo();
//native interface
[DllImport(pluginNameSecond)]
private static extern int foolib();
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
int i = foo();
myText.text = "HERE : " + i;
int il = foolib();
myText2.text = "HERE : " + il;
}
}
What is a possible issue?
Comment
Your answer
Follow this Question
Related Questions
How to use dlopen on OS X? 1 Answer
question about add dll in unity 0 Answers
Unity dll not found exception, but dll exist, what is a problem? 0 Answers
System.Drawing.dll usage in android 0 Answers