I am trying to import native library into my Xamarin Android app. I have built the test.so file and I have included the appropriate Dllopen code. The problem is when I attempt to deploy the app I keep getting a "DllImport error loading library" error thrown. Here is the error in full.
> DllImport attempting to load: 'test'. 07-20 11:07:26.428 D/Mono
> (11429): DllImport error loading library
> '/storage/emulated/0/Android/data/XammarinDemo.XammarinDemo/files/.__override__/libtest':
> 'dlopen failed: library
> "/data/app/XammarinDemo.XammarinDemo-1/lib/arm//storage/emulated/0/Android/data/XammarinDemo.XammarinDemo/files/.__override__/libtest"
> not found'. 07-20 11:07:26.428 D/Mono (11429): DllImport error
> loading library
> '/storage/emulated/0/Android/data/XammarinDemo.XammarinDemo/files/.__override__/libtest.so':
> 'dlopen failed: library
> "/data/app/XammarinDemo.XammarinDemo-1/lib/arm//storage/emulated/0/Android/data/XammarinDemo.XammarinDemo/files/.__override__/libtest.so"
> not found'. 07-20 11:07:26.428 D/Mono (11429): DllImport error
> loading library '/system/lib/libtest': 'dlopen failed: library
> "/data/app/XammarinDemo.XammarinDemo-1/lib/arm//system/lib/libtest"
> not found'. 07-20 11:07:26.428 D/Mono (11429): DllImport error
> loading library '/system/lib/libtest.so': 'dlopen failed: library
> "/data/app/XammarinDemo.XammarinDemo-1/lib/arm//system/lib/libtest.so"
> not found'. 07-20 11:07:26.428 D/Mono (11429): DllImport error
> loading library 'libtest': 'dlopen failed: library
> "/data/app/XammarinDemo.XammarinDemo-1/lib/arm/libtest" not found'.
> 07-20 11:07:26.428 D/Mono (11429): DllImport error loading library
> 'libtest.so': 'dlopen failed: library
> "/data/app/XammarinDemo.XammarinDemo-1/lib/arm/libtest.so" not found'.
> 07-20 11:07:26.428 D/Mono (11429): DllImport error loading library
> 'test': 'dlopen failed: library
> "/data/app/XammarinDemo.XammarinDemo-1/lib/arm/test" not found'. 07-20
> 11:07:26.438 D/Mono (11429): DllImport error loading library
> '/storage/emulated/0/Android/data/XammarinDemo.XammarinDemo/files/.__override__/libtest':
> 'dlopen failed: library
> "/data/app/XammarinDemo.XammarinDemo-1/lib/arm//storage/emulated/0/Android/data/XammarinDemo.XammarinDemo/files/.__override__/libtest"
> not found'. 07-20 11:07:26.438 D/Mono (11429): DllImport error
> loading library
> '/storage/emulated/0/Android/data/XammarinDemo.XammarinDemo/files/.__override__/libtest.so':
> 'dlopen failed: library
> "/data/app/XammarinDemo.XammarinDemo-1/lib/arm//storage/emulated/0/Android/data/XammarinDemo.XammarinDemo/files/.__override__/libtest.so"
> not found'. 07-20 11:07:26.438 D/Mono (11429): DllImport error
> loading library '/system/lib/libtest': 'dlopen failed: library
> "/data/app/XammarinDemo.XammarinDemo-1/lib/arm//system/lib/libtest"
> not found'. 07-20 11:07:26.438 D/Mono (11429): DllImport error
> loading library '/system/lib/libtest.so': 'dlopen failed: library
> "/data/app/XammarinDemo.XammarinDemo-1/lib/arm//system/lib/libtest.so"
> not found'. 07-20 11:07:26.438 D/Mono (11429): DllImport error
> loading library 'libtest': 'dlopen failed: library
> "/data/app/XammarinDemo.XammarinDemo-1/lib/arm/libtest" not found'.
> 07-20 11:07:26.438 D/Mono (11429): DllImport error loading library
> 'libtest.so': 'dlopen failed: library
> "/data/app/XammarinDemo.XammarinDemo-1/lib/arm/libtest.so" not found'.
> 07-20 11:07:26.438 D/Mono (11429): DllImport error loading library
> 'libtest': 'dlopen failed: library
> "/data/app/XammarinDemo.XammarinDemo-1/lib/arm/libtest" not found'.
> 07-20 11:07:26.438 W/Mono (11429): DllImport unable to load library
> 'dlopen failed: library
> "/data/app/XammarinDemo.XammarinDemo-1/lib/arm/libtest" not found'.
> 07-20 11:07:26.438 D/Mono (11429): DllImport attempting to load:
> 'test'. 07-20 11:07:26.438 D/Mono (11429): DllImport error loading
> library
> '/storage/emulated/0/Android/data/XammarinDemo.XammarinDemo/files/.__override__/libtest':
> 'dlopen failed: library
> "/data/app/XammarinDemo.XammarinDemo-1/lib/arm//storage/emulated/0/Android/data/XammarinDemo.XammarinDemo/files/.__override__/libtest"
> not found'. 07-20 11:07:26.438 D/Mono (11429): DllImport error
> loading library
> '/storage/emulated/0/Android/data/XammarinDemo.XammarinDemo/files/.__override__/libtest.so':
> 'dlopen failed: library
> "/data/app/XammarinDemo.XammarinDemo-1/lib/arm//storage/emulated/0/Android/data/XammarinDemo.XammarinDemo/files/.__override__/libtest.so"
> not found'. 07-20 11:07:26.438 D/Mono (11429): DllImport error
> loading library '/system/lib/libtest': 'dlopen failed: library
> "/data/app/XammarinDemo.XammarinDemo-1/lib/arm//system/lib/libtest"
> not found'. 07-20 11:07:26.438 D/Mono (11429): DllImport error
> loading library '/system/lib/libtest.so': 'dlopen failed: library
> "/data/app/XammarinDemo.XammarinDemo-1/lib/arm//system/lib/libtest.so"
> not found'. 07-20 11:07:26.438 D/Mono (11429): DllImport error
> loading library 'libtest': 'dlopen failed: library
> "/data/app/XammarinDemo.XammarinDemo-1/lib/arm/libtest" not found'.
> 07-20 11:07:26.438 D/Mono (11429): DllImport error loading library
> 'libtest.so': 'dlopen failed: library
> "/data/app/XammarinDemo.XammarinDemo-1/lib/arm/libtest.so" not found'.
I followed the process as described here https://developer.xamarin.com/guides/android/advanced_topics/using_native_libraries/. I confirmed the libtest.so is included in the apk by unzipping it, yet it seems android is having issues locating the .so file. How can I fix this issue?
According the xamarin docs you mention, you can use either path sniffing or the project file to have the linker know what's what.
Now, path sniffing does not really work with visual studio. Your dll's will be put in directories called ARM, ARM64 etc. And the path 'sniffer' expects the path to be like armeabi, armeabi-v7a, and so forth. You can either change the output path for every platform, or change your project file.
In case you go for the project file (which should be edited in manually in an external editor), the result should look something like this:
<ItemGroup>
<EmbeddedNativeLibrary Include="..\CD.AndroidDll\Release\ARM64\libDemo.so">
<Link>lib\arm64\libDemo.so</Link>
<ABI>arm64-v8a</ABI>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedNativeLibrary>
<EmbeddedNativeLibrary Include="..\CD.AndroidDll\Release\ARM\libDemo.so">
<Link>lib\arm\libDemo.so</Link>
<ABI>armeabi-v7a</ABI>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedNativeLibrary>
<EmbeddedNativeLibrary Include="..\CD.AndroidDll\Release\x64\libDemo.so">
<Link>lib\x64\libDemo.so</Link>
<ABI>x86_64</ABI>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedNativeLibrary>
<EmbeddedNativeLibrary Include="..\CD.AndroidDll\Release\x86\libDemo.so">
<Link>lib\x86\libDemo.so</Link>
<ABI>x86</ABI>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedNativeLibrary>
<None Include="Resources\AboutResources.txt" />
The only problem left is armeabi vs armeabi-v7a. It seems that the application does not look into the armeabi folder on a armeabi-v7a device. If you add both ABI definitions to the same linked library, only the second one is used. Neither can you link the same file twice.
Your only option would be to make a manual copy of the library and add that. Or just leave armeabi out altogether. After all, you would have a hard time finding a device which does not support armeabi-v7a nowadays.
Related
I have a .NET standard library which is used for the data access layer of my Xamarin Android app.
I have added a reference to the library however when attempting to use part of the library that is making web requests using System.Net.Http the app hangs and I get the following output.
03-01 16:13:22.914 D/Mono ( 1874): Image addref
System.Net.Http[0x7e2f1c7180] -> System.Net.Http.dll[0x7e2f4a2000]: 2
03-01 16:13:22.914 D/Mono ( 1874): Prepared to set up assembly
System.Net.Http' (System.Net.Http.dll)
03-01 16:13:22.914 D/Mono ( 1874): Assembly System.Net.Http[0x7e2f1c7180]
added to domain RootDomain, ref_count=1
03-01 16:13:22.917 D/Mono ( 1874): AOT: image 'System.Net.Http.dll.so'
not found: dlopen failed: library "/data/app/TestRecipeApp.TestRecipeApp-
1/lib/arm64/libaot-System.Net.Http.dll.so" not found
03-01 16:13:22.919 D/Mono ( 1874): AOT: image '/usr/local/lib/mono/aot-
cache/arm64/System.Net.Http.dll.so' not found: dlopen failed: library
"/data/app/TestRecipeApp.TestRecipeApp-1/lib/arm64/libaot-
System.Net.Http.dll.so" not found
03-01 16:13:22.920 D/Mono ( 1874): Config attempting to parse:
'System.Net.Http.dll.config'.
03-01 16:13:22.920 D/Mono ( 1874): Config attempting to parse:
'/usr/local/etc/mono/assemblies/System.Net.Http/System.Net.Http.config'.
03-01 16:13:22.920 D/Mono ( 1874): Assembly Ref addref
netstandard[0x7e2f594c00] -> System.Net.Http[0x7e2f1c7180]: 2
03-01 16:13:22.920 D/Mono ( 1874): Assembly Ref addref
System.Net.Http[0x7e2f1c7180] -> mscorlib[0x7e46b94000]: 14
Loaded assembly: System.Net.Http.dll [External]
Any suggestions would be much appreicxtated as this has taken a whole day of development time and I've still not found a solution.
When db.createUser is called below. The app hangs and does not proceed any further until it eventually crashes. I have tested the createUser function in a console application and it works fine so the problem doesn't seem to be in the class library itself.
class UserPresenter
{
ILoginView loginView;
DatabaseApi db;
public UserPresenter(ILoginView view)
{
this.loginView = view;
db = new DatabaseApi();
}
public void createUser(string email, string password)
{
Android.Util.Log.Error("myError", "In create user");
bool success = db.createUser(email, password);
Console.WriteLine("Success: " + success);
}
}
Cheers.
I'm using MvvmCross 5.6.3, VS 2017, debugging on Samsung S4.
The splash screen displays "Loading..." but the first ViewModel does not display.
The debug output window shows:
[0:] mvx:Diagnostic: 2.99 Setup: Secondary end
03-01 21:03:44.500 D/Mono (24569): DllImport searching in: '__Internal' ('(null)').
03-01 21:03:44.500 D/Mono (24569): Searching for 'java_interop_jnienv_new_string'.
03-01 21:03:44.500 D/Mono (24569): Probing 'java_interop_jnienv_new_string'.
03-01 21:03:44.500 D/Mono (24569): Found as 'java_interop_jnienv_new_string'.
03-01 21:03:44.500 D/Mono (24569): DllImport searching in: '__Internal' ('(null)').
03-01 21:03:44.500 D/Mono (24569): Searching for 'java_interop_jnienv_get_static_field_id'.
03-01 21:03:44.500 D/Mono (24569): Probing 'java_interop_jnienv_get_static_field_id'.
03-01 21:03:44.500 D/Mono (24569): Found as 'java_interop_jnienv_get_static_field_id'.
03-01 21:03:44.510 D/Mono (24569): DllImport searching in: '__Internal' ('(null)').
03-01 21:03:44.510 D/Mono (24569): Searching for 'java_interop_jnienv_get_static_object_field'.
03-01 21:03:44.510 D/Mono (24569): Probing 'java_interop_jnienv_get_static_object_field'.
03-01 21:03:44.510 D/Mono (24569): Found as 'java_interop_jnienv_get_static_object_field'.
Thread finished: <Thread Pool> #4
The thread 0x4 has exited with code 0 (0x0).
Thread finished: <Thread Pool> #2
and continues creating/finishing threads.
Because of Debug statements I can see that the Initialize method in App.cs completed.
Question:
Are there techniques/tools that will reveal where the code is looping?
Thank you,
Marc
I develped an OpenGL ES 3.0 app with Xamarin.Android. It runs well on my phone but crashed on the VS emulator for Android.
It crashes here:
at (wrapper managed-to-native) OpenTK.Graphics.ES30.GL/Core.CreateShader (OpenTK.Graphics.ES30.All) <0x00012>
And an error occurs before:
E/EGL_emulation( 1977): tid 1977: eglGetConfigAttrib(606): error 0x3004 (EGL_BAD_ATTRIBUTE)
I wonder if the simluator doesn't support OpenGL ES 3.0.
In the OpenGL ES Support section of this post,
VS Emulator for Android can now render apps that make use of OpenGL ES up to version 2.0
So, does the Visual Studio emulator for Android support OpenGL ES 3.0?
related logs:
D/Mono ( 1977): Found as 'java_interop_jnienv_get_object_array_element'.
E/EGL_emulation( 1977): [getAttribValue] Bad attribute idx
E/EGL_emulation( 1977): tid 1977: eglGetConfigAttrib(606): error 0x3004 (EGL_BAD_ATTRIBUTE)
D/Mono ( 1977): DllImport searching in: '__Internal' ('(null)').
D/Mono ( 1977): Searching for 'java_interop_jnienv_get_field_id'.
D/Mono ( 1977): Probing 'java_interop_jnienv_get_field_id'.
D/Mono ( 1977): Found as 'java_interop_jnienv_get_field_id'.
D/Mono ( 1977): DllImport searching in: '__Internal' ('(null)').
D/Mono ( 1977): Searching for 'java_interop_jnienv_get_int_field'.
D/Mono ( 1977): Probing 'java_interop_jnienv_get_int_field'.
D/Mono ( 1977): Found as 'java_interop_jnienv_get_int_field'.
D/Mono ( 1977): Assembly Ref addref Xamarin.OpenGL[0xb42b90a0] -> System[0x9e581dc0]: 4
D/Mono ( 1977): Assembly Ref addref Xamarin.OpenGL[0xb42b90a0] -> System.Core[0x9d8b71c0]: 4
Resolved pending breakpoint at 'ShaderProgram.cs:27,1' to void CSharpGLES.ShaderProgram.Create (string vertexShaderSource, string fragmentShaderSource, System.Collections.Generic.Dictionary<int,string> attributeLocations) [0x00001].
D/Mono ( 1977): DllImport attempting to load: 'GLESv2'.
D/Mono ( 1977): DllImport error loading library './libGLESv2': 'dlopen failed: library "/data/app/Xamarin.OpenGL.Xamarin.OpenGL-1/lib/x86/./libGLESv2" not found'.
D/Mono ( 1977): DllImport loaded library './libGLESv2.so'.
D/Mono ( 1977): DllImport searching in: 'GLESv2' ('./libGLESv2.so').
D/Mono ( 1977): Searching for 'glCreateShader'.
E/mono-rt ( 1977): Stacktrace:
E/mono-rt ( 1977):
E/mono-rt ( 1977): at <unknown> <0xffffffff>
E/mono-rt ( 1977): at (wrapper managed-to-native) OpenTK.Graphics.ES30.GL/Core.CreateShader (OpenTK.Graphics.ES30.All) <0x00012>
E/mono-rt ( 1977): at OpenTK.Graphics.ES30.GL.CreateShader (OpenTK.Graphics.ES30.All) [0x00002] in /Users/builder/data/lanes/4009/9578cdcd/source/monodroid/src/OpenGLES/OpenTK/Graphics/ES30.Android/GL.cs:1559
Related:
Does the Android Emulator support OpenGL ES 2.0?
Does the Android emulator support OpenGL ES 3.0?
Someone has found the answer for me: OpenGLES 3.0 hasn't been supported.
from https://blogs.msdn.microsoft.com/visualstudioalm/2015/02/23/the-visual-studio-emulator-for-android-in-vs2015-ctp6/
... the VS Emulator for Android can now render apps that make use of OpenGL ES > up to version 2.0. .... (If you’re curious, under the hood we’re forwarding
OpenGL ES calls to the host machine’s GPU and using ANGLE to translate the
calls to DirectX).
from ANGLE (https://chromium.googlesource.com/angle/angle/+/master/README.md)
still not fully support GLES3.0 (in progress).
so It may cause the error on shader compilation on the emulator.
Update:
A staff member of MS told me in another site that the driver of the emulator hasn't supported OpenGLES 3.0. So currently the emulator won't support OpenGL ES 3.0 even if ANGLE does support.
I'm currently developing an Android app that utilizes an existing native library written in C.
I managed to run the app on a Motorola Moto G2 (Android 6.0, armeabi-v7a), but on a Galaxy S2 (Android 4.1.2, also armeabi-v7a) I always get a DllNotFoundException.
When I run adb shell ls -l /data/data/com.my.app/lib I can see that the libmyutils.so is extracted from the respective ABI lib folder.
In the debug log is can see a lot of lines like this:
01-25 15:44:55.397 D/Mono (27537): DllImport error loading library './libmyutils': 'Cannot load library: load_library[1094]: Library '/data/data/com.my.app/lib/./libmyutils' not found'.
01-25 15:44:55.397 D/Mono (27537): DllImport error loading library './libmyutils.so': 'Cannot load library: find_library[1202]: 138 'libmyutils.so' failed to load previously'.
01-25 15:44:55.397 D/Mono (27537): DllImport error loading library '/system/lib/libmyutils': 'Cannot load library: load_library[1094]: Library '/data/data/com.my.app/lib//system/lib/libmyutils' not found'.
01-25 15:44:55.397 D/Mono (27537): DllImport error loading library '/system/lib/libmyutils.so': 'Cannot load library: find_library[1202]: 138 'libmyutils.so' failed to load previously'.
01-25 15:44:55.397 D/Mono (27537): DllImport error loading library 'libmyutils': 'Cannot load library: load_library[1094]: Library '/data/data/com.my.app/lib/libmyutils' not found'.
01-25 15:44:55.397 D/Mono (27537): DllImport error loading library 'libmyutils.so': 'Cannot load library: find_library[1202]: 138 'libmyutils.so' failed to load previously'.
01-25 15:44:55.397 D/Mono (27537): DllImport error loading library 'myutils': 'Cannot load library: load_library[1094]: Library '/data/data/com.my.app/lib/myutils' not found'.
01-25 15:44:55.397 D/Mono (27537): DllImport error loading library './libmyutils': 'Cannot load library: load_library[1094]: Library '/data/data/com.my.app/lib/./libmyutils' not found'.
01-25 15:44:55.397 D/Mono (27537): DllImport error loading library './libmyutils.so': 'Cannot load library: find_library[1202]: 138 'libmyutils.so' failed to load previously'.
01-25 15:44:55.397 D/Mono (27537): DllImport error loading library '/system/lib/libmyutils': 'Cannot load library: load_library[1094]: Library '/data/data/com.my.app/lib//system/lib/libmyutils' not found'.
01-25 15:44:55.397 D/Mono (27537): DllImport error loading library '/system/lib/libmyutils.so': 'Cannot load library: find_library[1202]: 138 'libmyutils.so' failed to load previously'.
01-25 15:44:55.397 D/Mono (27537): DllImport error loading library 'libmyutils': 'Cannot load library: load_library[1094]: Library '/data/data/com.my.app/lib/libmyutils' not found'.
01-25 15:44:55.397 D/Mono (27537): DllImport error loading library 'libmyutils.so': 'Cannot load library: find_library[1202]: 138 'libmyutils.so' failed to load previously'.
01-25 15:44:55.397 D/Mono (27537): DllImport error loading library 'libmyutils': 'Cannot load library: load_library[1094]: Library '/data/data/com.my.app/lib/libmyutils' not found'.
01-25 15:44:55.397 W/Mono (27537): DllImport unable to load library 'Cannot load library: load_library[1094]: Library '/data/data/com.my.app/lib/libmyutils' not found'.
Is this a compiler/architecture issue?
I'm looking forward to your help!
Best,
Marco
UPDATE: Solution
Finally it works! On the Galaxy S2 Android 4.1.2 I tried to call a native function by using the DllImport attribute and specified the library as myutils. After I had changed myutils to libmyutils.so the App was able to find the library. Unfortunately, it couldn't find a dependency library libdep1.so. What I did was to load the libraries in the correct order at startup using Java.Lang.JavaSystem.LoadLibrary("dep1") and then Java.Lang.JavaSystem.LoadLibrary("myutils"). This works even without the lib and .so pre-/suffix using only the library name. I could also switch back to from libmyutils.so to myutils in the DllImport attribute library name.
Old versions of Android had a bug in the linker where you had to load your native libraries in a specific order or they wouldn't load properly.
The best way to solve this is to use ReLinker. If you aren't using Java, the NDK ships a tool called ndk-depends that will tell you the correct load order for your shared libraries.
Note that you'll probably need to explicitly use Java.Lang.JavaSystem.LoadLibrary rather than DllImport.
On our Xamarin Android project we are trying to switch from sqlite-net to official sqlite-net-pcl package.
However after this switch when creating a new SQLiteConnection I am getting following exception:
The type initializer for 'SQLite.SQLiteConnection' threw an exception.
---> System.DllNotFoundException: e_sqlite3
Full exception:
Xamarin caused by: android.runtime.JavaProxyThrowable:
System.TypeInitializationException: The type initializer for
'SQLite.SQLiteConnection' threw an exception. --->
System.DllNotFoundException: e_sqlite3 at (wrapper
managed-to-native)
SQLitePCL.SQLite3Provider_e_sqlite3+NativeMethods:sqlite3_libversion_number
() at
SQLitePCL.SQLite3Provider_e_sqlite3.SQLitePCL.ISQLite3Provider.sqlite3_libversion_number
() [0x00000] in :0 at
SQLitePCL.raw.SetProvider (SQLitePCL.ISQLite3Provider imp) [0x00000]
in <4472a4c16754425197d915f39ebd937e>:0 at
SQLitePCL.Batteries_V2.Init () [0x0000d] in
<1125db7e18f0475797b2764ec6653cf1>:0 at
SQLite.SQLiteConnection..cctor () [0x00000] in
/Users/fak/Dropbox/Projects/sqlite-net/src/SQLite.cs:171 --- End
of inner exception stack trace --- at
mono.android.view.View_OnClickListenerImplementor.n_onClick(Native
Method) at
mono.android.view.View_OnClickListenerImplementor.onClick(View_OnClickListenerImplementor.java:30)
at android.view.View.performClick(View.java:4780) at
android.view.View$PerformClick.run(View.java:19866) at
android.os.Handler.handleCallback(Handler.java:739) at
android.os.Handler.dispatchMessage(Handler.java:95) at
android.os.Looper.loop(Looper.java:135) at
android.app.ActivityThread.main(ActivityThread.java:5254) at
java.lang.reflect.Method.invoke(Native Method) at
java.lang.reflect.Method.invoke(Method.java:372) at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
In the log I can see following info:
12-01 10:43:05.356 D/Mono (11194): DllImport attempting to load:
'e_sqlite3'. 12-01 10:43:05.358 D/Mono (11194): DllImport error
loading library
'/storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3':
'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86//storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3"
not found'. 12-01 10:43:05.360 D/Mono (11194): DllImport error
loading library
'/storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3.so':
'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86//storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3.so"
not found'. 12-01 10:43:05.360 D/Mono (11194): DllImport error
loading library '/system/lib/libe_sqlite3': 'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86//system/lib/libe_sqlite3" not
found'. 12-01 10:43:05.360 D/Mono (11194): DllImport error loading
library '/system/lib/libe_sqlite3.so': 'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86//system/lib/libe_sqlite3.so"
not found'. 12-01 10:43:05.360 D/Mono (11194): DllImport error
loading library 'libe_sqlite3': 'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86/libe_sqlite3" not found'.
12-01 10:43:05.361 D/Mono (11194): DllImport error loading library
'libe_sqlite3.so': 'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86/libe_sqlite3.so" not found'.
12-01 10:43:05.361 D/Mono (11194): DllImport error loading library
'e_sqlite3': 'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86/e_sqlite3" not found'. 12-01
10:43:05.362 D/Mono (11194): DllImport error loading library
'/storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3':
'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86//storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3"
not found'. 12-01 10:43:05.364 D/Mono (11194): DllImport error
loading library
'/storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3.so':
'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86//storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3.so"
not found'. 12-01 10:43:05.364 D/Mono (11194): DllImport error
loading library '/system/lib/libe_sqlite3': 'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86//system/lib/libe_sqlite3" not
found'. 12-01 10:43:05.364 D/Mono (11194): DllImport error loading
library '/system/lib/libe_sqlite3.so': 'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86//system/lib/libe_sqlite3.so"
not found'. 12-01 10:43:05.364 D/Mono (11194): DllImport error
loading library 'libe_sqlite3': 'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86/libe_sqlite3" not found'.
12-01 10:43:05.364 D/Mono (11194): DllImport error loading library
'libe_sqlite3.so': 'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86/libe_sqlite3.so" not found'.
12-01 10:43:05.365 D/Mono (11194): DllImport error loading library
'libe_sqlite3': 'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86/libe_sqlite3" not found'.
12-01 10:43:05.365 W/Mono (11194): DllImport unable to load library
'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86/libe_sqlite3" not found'.
12-01 10:43:05.365 D/Mono (11194): DllImport attempting to load:
'e_sqlite3'. 12-01 10:43:05.366 D/Mono (11194): DllImport error
loading library
'/storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3':
'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86//storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3"
not found'. 12-01 10:43:05.368 D/Mono (11194): DllImport error
loading library
'/storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3.so':
'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86//storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3.so"
not found'. 12-01 10:43:05.368 D/Mono (11194): DllImport error
loading library '/system/lib/libe_sqlite3': 'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86//system/lib/libe_sqlite3" not
found'. 12-01 10:43:05.368 D/Mono (11194): DllImport error loading
library '/system/lib/libe_sqlite3.so': 'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86//system/lib/libe_sqlite3.so"
not found'. 12-01 10:43:05.368 D/Mono (11194): DllImport error
loading library 'libe_sqlite3': 'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86/libe_sqlite3" not found'.
12-01 10:43:05.368 D/Mono (11194): DllImport error loading library
'libe_sqlite3.so': 'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86/libe_sqlite3.so" not found'.
12-01 10:43:05.369 D/Mono (11194): DllImport error loading library
'e_sqlite3': 'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86/e_sqlite3" not found'. 12-01
10:43:05.370 D/Mono (11194): DllImport error loading library
'/storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3':
'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86//storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3"
not found'. 12-01 10:43:05.371 D/Mono (11194): DllImport error
loading library
'/storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3.so':
'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86//storage/emulated/0/Android/data/com.psonar.android/files/.override/libe_sqlite3.so"
not found'. 12-01 10:43:05.372 D/Mono (11194): DllImport error
loading library '/system/lib/libe_sqlite3': 'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86//system/lib/libe_sqlite3" not
found'. 12-01 10:43:05.372 D/Mono (11194): DllImport error loading
library '/system/lib/libe_sqlite3.so': 'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86//system/lib/libe_sqlite3.so"
not found'. 12-01 10:43:05.372 D/Mono (11194): DllImport error
loading library 'libe_sqlite3': 'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86/libe_sqlite3" not found'.
12-01 10:43:05.372 D/Mono (11194): DllImport error loading library
'libe_sqlite3.so': 'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86/libe_sqlite3.so" not found'.
12-01 10:43:05.373 D/Mono (11194): DllImport error loading library
'libe_sqlite3': 'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86/libe_sqlite3" not found'.
12-01 10:43:05.373 W/Mono (11194): DllImport unable to load library
'dlopen failed: library
"/data/app/com.psonar.android-1/lib/x86/libe_sqlite3" not found'.
It's obvious what's wrong: System.DllNotFoundException: e_sqlite3 however I can't find any relevant info that would lead to solving this problem.
I checked my nuget packages and they all seem to be correctly installed.
I checked the package location and it is all correct. Very unsure where the cause might be.
EDIT:
Reported to the author of the package in here:
https://github.com/praeclarum/sqlite-net/issues/478
The nuget package had to be installed in our main droid app project as well. If it is installed in a solution project which is not the app start project then it creates these problems.
I know that's an old post, and sorry for resume that,
To answer #sagar-panwala that cannot fix the problem, ther easyest way is to fix that problem without become mad with nu-get plugins is set the .droid project as "StartupProject" when compiling for android:
Probably there was an error in the original nuget package.