DLL not found

I assume a project with an API minimum level can run a higher level
27 looks to be Oreo 8.1

No luck, still getting the same error… and yes you can run at a higher level

I don’t know how much work that would take you, but we could try to test your build setup independently from the Pulse library, that way we could identify if the problem is with the build setup or with building the actual Pulse engine. Could you just make a simple c++ file with an Add x+y function, and build it? then we can test it and if it works we know the build setup is good.

That is a great idea

Here are two libraries.
They should be the same, version 2 removes the C_CALL macro
https://data.kitware.com/#collection/59849c788d777f7d33e9c084/folder/5f22bb599014a6d84e4af03d

Ok, about how I build the project. I am using the vitals monitor scene, changing the .so file in the assets/plugin folder and then building to both an ARMv7 and ARM64 device using Mono or IL2CPP. I am using API level 19 as minimum too.

When you use Nox, create an apk file and then install it as usual. Nox supports these architectures:
[ro.product.cpu.abi]: [x86]
[ro.product.cpu.abilist]: [x86,armeabi-v7a,armeabi]
[ro.product.cpu.abilist32]: [x86,armeabi-v7a,armeabi]
[ro.product.cpu.abilist64]: []

oh, and the last one you sent did not work for me either.

Couldn’t get either to work…

Both Nox and BlueStacks require me to configure my system so I can’t run docker anymore
Which I use to build the cross compiled library

Let me see if I can get an emulator from android studio

I will also dig into the NDK cross compiling documentation as well

vasco, do you have a C# script (or a unity asset file) you can push for the adder test?
Try to push to that folder?
https://data.kitware.com#authorized_upload/5f22bb599014a6d84e4af03d/t0t26zraBwffvQAvMTCkmo5i5TZi4HUg3qtHTZsYWQJcn3IoCTvYpLk6JJp9Fdca

Just uploaded a script called CallNativeCode.cs, you only need to attach it to a gameobject on a scene.

It assumes that you have an .so called “libadder.so” inside Assets/Plugins/Android/

And it is calling the method double Sum(double a, double b);

image

I was able to build the simple adder library and run it on my pixel 3a

Updated libraries and executable are armv8a and are here:
https://data.kitware.com/#collection/59849c788d777f7d33e9c084/folder/5f22bb599014a6d84e4af03d

I am also providing the library "libc++_shared.so
as I got the error: CANNOT LINK EXECUTABLE “./main-adder”: library “libc++_shared.so” not found
(maybe this was our problem the whole time?)

I tried to figure out the linker flags to get it to link stl statically, but it was just not happening.
It seems that the sop is to just package this file in the apk
So I am fine with providing it in my unity package as well

@vascoptorres, you want to give this a shot in unity

Wow, I think we got progress here:

I made a IL2CPP build to run the armv8 version, first with the libadder.so library but it gave me the usual DllNotFoundException. But then I tried with the libc++_shared.so, and now I get:

EntryPointNotFoundException: Unable to find an entry point named 'Sum' in 'adder'

Which means the library is loaded, it just can’t find the method Sum that I’m trying to invoke.

What’s inside libc++_shared.so? I’m trying to call the method: double Sum(double a, double b);

By default the android C++ library only supports something like new and delete. And if you want to actually use more C++ you have to link to a complete implementation of C++ (which is mostly STL and other funzies) libc++_shared.so is that implementation.

I was also able to run Pulse on my Android, and the run time was decent (All files are posted in the examples/xcompile link in my last post)

Top is my phone, bottom is my Surface3 Laptop

I was able to run it through adb, but I still can’t run it through Unity…

Try

[DllImport(“adder”, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
private static extern double Sum(double a, double b);

It worked, I was missing the libc++shared.so

Are you able to create it for armv7?

I tested now with the PulseC.so, and the library seems to be loading just fine, but I’m getting this error when I launch the VitalsMonitor scene:

07-31 16:02:26.499 31303 31317 I Unity   : SystemInfo CPU = ARM64, Cores = 8, Memory = 2682mb
07-31 16:02:26.499 31303 31317 I Unity   : SystemInfo ARM big.LITTLE configuration: 4 big (mask: 0xf0), 4 little (mask: 0xf)
07-31 16:02:26.500 31303 31317 I Unity   : ApplicationInfo com.DefaultCompany.testproj version 0.1 build 07-31 16:02:26.500 31303 31317 I Unity   : Built from '2019.4/staging' branch, Version '2019.4.5f1 (81610f64359c)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a', Stripping 'Disabled'
07-31 16:02:29.721 31303 31317 E Unity   : DescriptorValidationException: pulse.cdm.bind.DoubleArrayData.Value: Property Value not found in pulse.cdm.bind.DoubleArrayData
07-31 16:02:29.721 31303 31317 E Unity   :   at Google.Protobuf.Reflection.FieldDescriptor.CreateAccessor () [0x00000] in <00000000000000000000000000000000>:0
62d65c8b-a3b6-40f8-9429-93ea6e34471a
07-31 16:02:29.721 31303 31317 E Unity   :   at Google.Protobuf.Reflection.FieldDescriptor.CrossLink () [0x00000] in <00000000000000000000000000000000>:0
07-31 16:02:29.721 31303 31317 E Unity   :   at Google.Protobuf.Reflection.MessageDescriptor.CrossLink () [0x00000] in <00000000000000000000000000000000>:0
07-31 16:02:29.721 31303 31317 E Unity   :   at Google.Protobuf.Reflection.FileDescriptor.CrossLink () [0x00000] in <00000000000000000000000000000000>:0
07-31 16:02:29.721 31303 31317 E Unity   :   at Google.Protobuf.Reflection.FileDescriptor.BuildFrom (Google.Protobuf.ByteString descriptorData, Google.Protobuf.Reflection.FileDescriptorProto proto, Google.Protobuf.Reflection.FileDescriptor[] dependencies, System.Boolean allowUnknownDependencies, Google.Protobuf.Reflection.GeneratedClrTypeInfo generatedCodeInfo) [0x00000] in <00000000000000000000000000000000>:0
07-31 16:02:29.721 31303 31317 E Unity   :   at Google.Protobuf.Reflection.FileDescriptor.FromGeneratedCode (Sys

Did you add a link.xml file to your project?

I think I just need to push up the armv7a version of the libc++shared.so to the Android-arm folder…

I added the libc++shared.so files to the 2 android folders here
https://data.kitware.com/#collection/59849c788d777f7d33e9c084/folder/5da739b0d35580e6dc9e9c79

Just added the link.xml to Assets root folder but I’m still getting the same error…

do you have more of the call stack?
I am not sure what you are calling in the Pulse API
Like loading a file? or is this just on Allocate still?

That’s all I get on adb logcat…
I just imported the Pulse package into unity, added the ARMv8 .so files, added the VitalsMonitor scene and built it with il2cpp.

That error appears when the VitalsMonitor scene starts…

pulse.cdm.bind.DoubleArrayData.Value does indeed exist,
But IL2CPP is stripping it out. I have seen this same call stack before, and the linker.xml file did the trick and told IL2CPP not to remove that function from the DataModelBindings…oh wait, the dll name changed, update your build.xml to :

<linker>
  <assembly fullname="System" preserve="all"/>
  <assembly fullname="Google.Protobuf" preserve="all"/>
  <assembly fullname="Pulse" preserve="all"/>
</linker>