Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android port #39

Open
Tenacious-R opened this issue Feb 7, 2021 · 5 comments
Open

Android port #39

Tenacious-R opened this issue Feb 7, 2021 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@Tenacious-R
Copy link

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?

@keijiro keijiro self-assigned this Feb 7, 2021
@keijiro keijiro added the question Further information is requested label Feb 7, 2021
@keijiro
Copy link
Owner

keijiro commented Feb 7, 2021

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++.

@Tenacious-R
Copy link
Author

Yes I tried that but its still not loading. Using Visual Studio I have -static-libstdc++ set in additional dependencies.

@keijiro
Copy link
Owner

keijiro commented Feb 8, 2021

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.

@Tenacious-R
Copy link
Author

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?

@keijiro
Copy link
Owner

keijiro commented Feb 9, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants