I was trying to build c++ native plugin for unity android and facing dll not found issue and then I tried the sample native plugin package unity providing in this link Unity - Manual: Call native plug-in for Android code and I found the error when running
Exception: DllNotFoundException: Unable to load DLL ‘native’. Tried the load the following dynamic libraries: Unable to load dynamic library ‘native’ because of 'Failed to open the requested dynamic library (0x06000000) dlerror() = dlopen failed: library “native” not found
CallNativeCode.add (System.Single x, System.Single y) (at <00000000000000000000000000000000>:0)
CallNativeCode.Start () (at <00000000000000000000000000000000>:0)
The packages I built also was giving same errors.
How to solve this problem?
Could you show the code for your C# script, C++ code and how you’ve setup the plugins?
I have imported the sample asset from this link Unity - Manual: Call native plug-in for Android code and build the scene for android. Before building I have set the script compiling mode to L2CPP and enabled for armv8 in player settings.
Yikes, that sample project is very out of date. It only contains armv7 native library, so to run it on armv8 you need to recompile the library yourself for that architecture.
Thanks. Yes it’s working in armv7
Hey @mmar58 , thank you for reporting this issue.
The docs have now been updated, AndroidNativePlugin.unitypackage now includes native libraries for all the architectures Unity supports (armv7
, arm64
, x86
and x86_64
).
Unity editor version is 2021.3.45f1, unity jar EDM4U is last version, I have a project file is mobile app. In my project tools is Firebase Auth, Remote Config and Messaging. My Google Sign In package stopped working after this jar update and I get this error:
2024/11/20 18:39:52.983 9891 9944 Error Unity DllNotFoundException: Cannot load DLL ‘native-googlesignin’. I tried loading the following dynamic libraries: 'Unable to load dynamic library ‘native-googlesignin’ due to ‘Failed to open requested dynamic library (0x06000000) dlerror() = dlopen failed: library “native-googlesignin” not found’
What should I do?
I’m in project file ise EDM4U last uptade. Thank you…
I was searching the solution about a week. That is the answer . Just remove the arm8(arm64) and check arm7. Thank you so much!
I’m facing this issue after importing Firestore and clicking External Dependency Manager → Android Resolver → Force Resolve
The settingsTemplate.gradle
file gets updated incorrectly. Initially, it contains:
maven {
url (unityProjectPath + "/Assets/GeneratedLocalRepo/GoogleSignIn/Editor/m2repository")
}
After resolving dependencies, it changes to the wrong path:
maven {
url (unityProjectPath + "/Assets/GoogleSignIn/Editor/m2repository")
}
This incorrect path causes the “Unable to load DLL ‘native-googlesignin’” error.
Solution
Manually update the path back to the correct one:
maven {
url (unityProjectPath + "/Assets/GeneratedLocalRepo/GoogleSignIn/Editor/m2repository")
}
This resolves GoogleSignIn issues and fixes the “Unable to load DLL ‘native-googlesignin’” error.