Closed iwatake2222 closed 2 years ago
It's not a question, so I just close this issue now.
Thank you for the notice!
I will give a try and see if it also works with my phone. I took the libusb build from the Luxonis fork, but I am glad to hear that it also works building it directly.
I have just tested it and was able to reproduce the errors. I have updated the repository with a slight modification of your changes. Thanks!
Great!!
Thanks @iwatake2222 for checking this out and proposing the fix. We have our own fork of libusb, which is also going to get used by DepthAI once we mainline Android support.
Do you mind opening a PR with the fix against cmake_android
branch of: https://github.com/luxonis/libusb/
@ibaiGorordo I see you already created a fork & fix - do you mind opening a PR back? Just one regard, use the enum/flag instead of the magic number if possible. If the flag isn't available pre Android12, use ifdef / other mechanism to select this flag value
Thank you for sharing the great project ! I tried the project with Pixel 4a + Android 12 and found there are some issues. So I'd like to share my solutions (I'm not sure if the solution is the best and it may cause another problem in another environment. So I just post an issue here rather than sending a pull request). Hope it helps someone.
Issue 1
Detail
When I ran the project with Android 12, the following error happens:
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
Log cat
Solution
libusb-1.0.so
PendingIntent.FLAG_IMMUTABLE
flag topermission_intent
inlinux_android_jni.c
Issue 2
Detail
It may be a minor issue but I faced build error missing
depthai/build/config.hpp
inImgFrame.hpp
Solution
#include "depthai/build/config.hpp"
inImgFrame.hpp
Overall
I modified like the followings and it works well with Android 12