KlakHap
KlakHap copied to clipboard
Android port
Trying to port to Android to play small video loops on a ChromeBook,, the Hap larger file size is not an issue as the videos I'm using are quite small.
I was able to build the library .so (tried both arm7 and arm64) but when run on device the videos are blank with an error: DllNotFoundException: Unable to load DLL 'KlakHap': The specified module could not be found.
Looking inside the .apk and the libKlakHap.so is included so I'm not sure what is wrong?
Did you use the -static-libstdc++
linker option?
https://github.com/keijiro/UnityPluginWithWSL/blob/master/Plugin/Makefile.android#L8
Unity will fail to load the native plugin if it's dynamically linked to libstdc++.
Yes I tried that but its still not loading. Using Visual Studio I have -static-libstdc++ set in additional dependencies.
Did you check if the libKlakHap.so
is actually your file? This package has a file with the same filename for x86 Linux, so I wonder if Unity could pick it up in a wrong way.
I have made some progress, I replaced VisualStudio with AndroidStudio and no longer get the DLL not found error instead I am getting a failed to open stream error. I have set PathMode to StreamingAssets and have checked the video is included in the build in the assets folder which appears to match the resolved File Path /base.apk!/assets/v5.mov?
Unfortunately, I don't have much experience on Android, but I'm pretty sure that that's one of the common problems on Unity/Android dev. Probably, you can find some hints/knowledges by Googling.