Dockerfile for Building Android
Fixes https://github.com/mavlink/qgroundcontrol/issues/10995
similar to https://github.com/mavlink/qgroundcontrol/pull/11855
this is almost working for me, but no matter what I do I cannot get it to compile with gstreamer properly. My build seems to get all the way to the end and then fails with the following error
ld: error: duplicate symbol: gst_android_get_application_class_loader
>>> defined at AndroidInit.cpp:23 (/project/source/android/src/AndroidInit.cpp:23)
>>> CMakeFiles/QGroundControl.dir/android/src/AndroidInit.cpp.o:(gst_android_get_application_class_loader)
>>> defined at gstandroid.c:413 (/home/nirbheek/projects/repos/cerbero.git/1.22/build/sources/android_universal/armv7/gstreamer-1.0-1.22.12/_builddir/../gst/gstandroid.c:413)
>>> gstandroid.c.o:(.text.gst_android_get_application_class_loader+0x1) in archive _deps/gstreamer/install/gstreamer/armv7/lib/libgstreamer-1.0.a
ld: error: duplicate symbol: JNI_OnLoad
>>> defined at AndroidInit.cpp:81 (/project/source/android/src/AndroidInit.cpp:81)
>>> CMakeFiles/QGroundControl.dir/android/src/AndroidInit.cpp.o:(JNI_OnLoad)
>>> defined at gstandroid.c:559 (/home/nirbheek/projects/repos/cerbero.git/1.22/build/sources/android_universal/armv7/gstreamer-1.0-1.22.12/_builddir/../gst/gstandroid.c:559)
>>> gstandroid.c.o:(.text.JNI_OnLoad+0x1) in archive _deps/gstreamer/install/gstreamer/armv7/lib/libgstreamer-1.0.a
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
Let me know if anyone has any tips for making sure these functions aren't duplicated
Yes this is the most obnoxious error and is the reason I couldn't do several things. As far as I understand, you have to link a library that has a JNI_OnLoad dynamically then use QLibrary to load the shared lib. Although Qt6.8 changes something about how it uses JNI_OnLoad but I don't know if it fixes this or not.
@HTRamsey what I don't understand is how the CI pipeline is building fine, but my docker container does not. I really don't understand what could be different.
What's the status on this?
I still can't get gstreamer to build properly. I still cannot figure out how the CI pipeline is different. Other than gstreamer error above this almost works
I will try it out and see what I can do
I tried this out and it's very strange I don't know what's happening
I'm just going to merge this so I can work on it