nunit.xamarin icon indicating copy to clipboard operation
nunit.xamarin copied to clipboard

Cannot run test with EmbeddedNativeLibrary

Open ursen opened this issue 8 years ago • 3 comments

Hi, We are having problems running NUnit Unit Tests in a Xamarin.Android Project. We are trying to test an Android Class Library Project that is using four EmbeddedNativeLibraries internally. When trying to run our NUnit unit test it fails on loading the libraries with the error

DllImport attempting to load: 'libNAME.so'. 12-19 18:07:54.561 D/Mono (13724): DllImport error loading library '/storage/emulated/0/Android/data/NAME.Api.Wrapper.Test.Runner/files/.override/libNAME.so': 'dlopen failed: library "/data/app/NAME.Api.Wrapper.Test.Runner-1/lib/arm//storage/emulated/0/Android/data/NAME.Api.Wrapper.Test.Runner/files/.override/libNAME.so" not found'. 12-19 18:07:54.562 D/Mono (13724): DllImport error loading library '/storage/emulated/0/Android/data/NAME.Api.Wrapper.Test.Runner/files/.override/libNAME.so': 'dlopen failed: library "/data/app/NAME.Api.Wrapper.Test.Runner-1/lib/arm//storage/emulated/0/Android/data/NAME.Api.Wrapper.Test.Runner/files/.override/libNAME.so" not found'. 12-19 18:07:54.563 D/Mono (13724): DllImport error loading library '/system/lib/libNAME.so': 'dlopen failed: library "/data/app/NAME.Api.Wrapper.Test.Runner-1/lib/arm//system/lib/libNAME.so" not found'. 12-19 18:07:54.564 D/Mono (13724): DllImport error loading library '/system/lib/libNAME.so': 'dlopen failed: library "/data/app/NAME.Api.Wrapper.Test.Runner-1/lib/arm//system/lib/libNAME.so" not found'. 12-19 18:07:54.566 D/Mono (13724): DllImport error loading library 'libNAME.so': 'dlopen failed: library "libNAME_imaging.so" not found'. 12-19 18:07:54.567 D/Mono (13724): DllImport error loading library 'libNAME.so': 'dlopen failed: library "libNAME_imaging.so" not found'. 12-19 18:07:54.573 D/Mono (13724): DllImport error loading library 'libNAME.so': 'dlopen failed: library "libNAME_imaging.so" not found'. 12-19 18:07:54.573 W/Mono (13724): DllImport unable to load library 'dlopen failed: library "libNAME_imaging.so" not found'.

Things we have done so far:

  • We have created a test runner project for Android using the NUnit templates given here: Templates.
  • The test runner project is using NUnit and nunit.xamarin version 3.0.1.
  • We are not using Xamarin.Forms anywhere, just Xamarin.Android.
  • The Android Library Project we are trying to test is not doing any UI stuff.
  • We tried putting a copy of the libraries into the test runner project.
  • We tried having the test in the test runner project and in a separate test project.
  • We looked into the dll, the apk and checked the file system of our test device via adb. The libraries were present in all places.

Are we doing something wrong or is this simply not supported ?

ursen avatar Dec 19 '16 17:12 ursen

It looks like you have tried everything that I would have tried and then some. When I get a chance, I will try to reproduce with a simpler project and see if I can offer any suggestions or solutions.

rprouse avatar Dec 20 '16 23:12 rprouse

Hi, Are there any updates on this ?

ursen avatar Jan 25 '17 14:01 ursen

@rprouse Not meaning to bother you, are there any updates to this ?

ursen avatar Feb 20 '17 13:02 ursen