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

Dockerfile for Building Android #12000

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ericjohnson97
Copy link

Fixes #10995

similar to #11855

@ericjohnson97
Copy link
Author

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

@HTRamsey
Copy link
Collaborator

HTRamsey commented Oct 12, 2024

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.

@ericjohnson97
Copy link
Author

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

@HTRamsey
Copy link
Collaborator

What's the status on this?

@ericjohnson97
Copy link
Author

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

@HTRamsey
Copy link
Collaborator

I will try it out and see what I can do

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

Successfully merging this pull request may close these issues.

Build APK using Docker
2 participants