How to build for Android #24
Labels
No labels
3rdparty
Android
API
Author does not respond
bsd
bug
build system/CI
ci-virtual-device
CMake
Contributions Welcome
Core
dependencies
device-specific
documentation
don't_merge
duplicate
enhancement
Example
Haiku
hidraw
hotplug
info required
invalid
libusb
macOS
Misc
Not an issue
question
Release
Test
Test GUI
Windows
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-libusb/hidapi#24
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
With the following modifications to the Android.mk file, the build succeeds (using
~/Android/Sdk/ndk-bundle/ndk-build):See also https://developer.android.com/ndk/guides/android_mk#my-dir
I'm not familiar with
.mkand Android build system, but I'm almost sure, that there has to be a better way specifying dependency, instead of hard-coding it.I am struggling with the same issue and a complete dirth of any information surrounding linking jni's to jni's on the internet at all. Nothing I do seems to let hidapi find libusb1.0. I perpetually see Android NDK: Module hidapi depends on undefined modules: usb1.0 . If anyone can shed light on the "proper" way to build the Android NDK module, please let me know!
P.S. THANK YOU SO MUCH FOR POSTING THIS! Though a bit kludgy, your solution works!
thanks for posting this, it should be added to master.
Again, hard-coding full system-specific paths is definitely not something we should have in master.
I'll have Android project to play soon, and will try to find elegant solution.
Because I didn't really understand this fully at first, I worked it out in a script
The point that I entirely missed was that I had to clone libusb/libusb too and point to its
Android.mkfile.Note: The script does everything. It also clones this repository, which is more than you need if you already have this cloned.
At this point I think it should be enough to say that CMake build works perfectly fine on Android (I'm using it in my personal projects).
For that two things needed:
As for
Android.mkpresent in the repo - time to deprecated it.Those who really need it - would know how to use it.
All others should probably use CMake build. Gradle (as native build tool for Android) supports CMake too.