Compiling: Build tools and dependencies fails
#1
As instructed here, I am trying to cross-compile Kodi Omega build tools and dependencies for Android ARM architecture on latest Ubuntu 22.04.4 LTS jammy x86_64. Everything goes flawlessly until step no. 5, where after 15 minutes of compiling it fails here:

https://pastebin.com/zP4PKb65

I already tried to compile on another clean Ubuntu installation, but the result is the same.
Any help on how to troubleshoot would be very appreciated.
Thank you in advance!
Reply
#2
Most likely need to use an older NDK, or increase the minimum sdk version.

Team Kodi's CI uses NDK 21e for Omega. https://github.com/android/ndk/wiki/Unsu...-Downloads
Reply
#3
Boom, that was it:

Code:
installed-arm-linux-androideabi-21-debug
Dependencies built successfully.
make[1]: Leaving directory '/home/ubuntu/kodi/tools/depends/target'

Thanks a bunch @Fuzzard, now I can dive into compiling an add-on for Android. Hopefully it works :-)
Reply
#4
@Fuzzard I ran into another issue after compiling the according add-on. Are you mayble willing to help me again?
After compiling and generating the according add-on package, I imported it into into the filesystem of my Fairphone 3 Android 13 device, started Kodi and tried to install the package, which was being quit with the following error message:

Code:
...failed due to an invalid file structure.

The following are the steps I took to compile the add-on:


Before compiling the add-on I checked by uname -m on my Android device for the system architecture, which says aarch64. So I obviously set up the building environment to aarch64 as follows:

Code:
cd $HOME/android-tools/android-sdk-linux/cmdline-tools/bin
./sdkmanager --sdk_root=$(pwd)/../.. --licenses
./sdkmanager --sdk_root=$(pwd)/../.. platform-tools
./sdkmanager --sdk_root=$(pwd)/../.. "platforms;android-33"
./sdkmanager --sdk_root=$(pwd)/../.. "build-tools;33.0.1"
./sdkmanager --sdk_root=$(pwd)/../.. "ndk;21.4.7075529"

...

Code:
./configure --with-tarballs=$HOME/android-tools/xbmc-tarballs --host=aarch64-linux-android --with-sdk-path=$HOME/android-tools/android-sdk-linux --with-ndk-path=$HOME/android-tools/android-sdk-linux/ndk/21.4.7075529 --prefix=$HOME/android-tools/xbmc-depends
make -j$(getconf _NPROCESSORS_ONLN)

Then, after the build environment was successfully built, I started to compile and generate the add-on package as follows:

Code:
make -j$(getconf _NPROCESSORS_ONLN) -C tools/depends/target/binary-addons ADDONS="pvr.teleboy"

Code:
cd $HOME/kodi/tools/depends/target/binary-addons/aarch64-linux-android-21-debug
make package-pvr.teleboy

The according add-on .ZIP-package was successfully being created here:
Code:
cd $HOME/kodi/tools/depends/target/binary-addons/aarch64-linux-android-21-debug/pvr.teleboy-prefix/src/pvr.teleboy-build

On the generated add-on .ZIP-package the file structure now looks like this:

Code:
.
├── lib
│   └── kodi
│       └── addons
│           └── pvr.teleboy
│               └── libpvr.teleboy.so
└── share
    └── kodi
        └── addons
            └── pvr.teleboy
                ├── addon.xml
                ├── fanart.jpg
                ├── icon.png
                ├── libpvr.teleboy.so
                ├── LICENSE.txt
                └── resources
                    ├── eit_categories.txt
                    ├── language
                    │   └── resource.language.en_gb
                    │       └── strings.po
                    │   └── resource.language.de_de
                    │       └── strings.po
                    └── settings.xml

Any hints why this is not working to install?
Thank you!
Reply
#5
OK, as I compared the add-on .ZIP-package with the one I compiled successfully for Linux I mentioned the wrong file structure, so I changed it as follows and compressed it manually into a .ZIP-file again:

Code:
             pvr.teleboy
                ├── addon.xml
                ├── fanart.jpg
                ├── icon.png
                ├── libpvr.teleboy.so
                ├── LICENSE.txt
                └── resources
                    ├── eit_categories.txt
                    ├── language
                    │   └── resource.language.en_gb
                    │       └── strings.po
                    │   └── resource.language.de_de
                    │       └── strings.po
                    └── settings.xml

After that I was finally able to install the add-on successfully.
Even I don't know why the file structure is originally being generated completely wrong, maybe someone has an explanation for this  Confused
Thank you again for your help!
Reply
#6
Understanding the Error:
The error message you shared on Pastebin (https://pastebin.com/zP4PKb65) indicates an issue during the compilation of a specific source file (ADM/ADM_threads.cpp). It seems the compiler is encountering an undefined reference to the symbol pthread_mutexattr_settype(). This suggests a missing library or header file that provides this function.
Troubleshooting Steps:
Verify Library Installation:
Make sure you have the necessary development libraries for pthreads (POSIX Threads) installed. Run the following command in your terminal:
Bash
sudo apt install libpthread-dev
Use code with caution.
If it's already installed, try reinstalling it:
Bash
sudo apt reinstall libpthread-dev
Use code with caution.
Check Header Search Paths:
The compiler might not be searching the correct directory for the header file that defines pthread_mutexattr_settype(). You might need to adjust the build flags or environment variables.
Consult the Kodi Omega build documentation or community forums for specific instructions on setting header search paths for cross-compiling to Android ARM.
Clean and Rebuild:
Sometimes, a clean slate can help resolve build issues. Try removing any intermediate build files and starting the compilation process again:
Bash
cd <kodi-omega-source-directory> make clean ./configure --target=arm-linux-androideabi make
Use code with caution.
Review Kodi Omega Documentation:
The official Kodi Omega build documentation may have specific instructions for cross-compiling on Ubuntu with ARM targets. Refer to the documentation for any additional configuration steps or troubleshooting advice.
Seek Community Help:
If the above steps don't resolve the issue, consider seeking assistance from the Kodi community forums or developers:
Official Kodi forum: https://forum.kodi.tv/
Kodi GitHub repository: https://github.com/xbmc/xbmc
Additional Considerations:
Compiler Version: Using a compatible compiler version with Kodi Omega's requirements might be necessary.
Dependency Conflicts: Ensure no other libraries installed on your system are interfering with the compilation process.
Disclaimer:
Cross-compiling Kodi Omega is a complex process, and the solutions might vary depending on the specific Kodi version, tools, and environment. This response aims to provide a general troubleshooting framework.
I hope this comprehensive guidance helps you successfully cross-compile Kodi Omega on your Ubuntu system. Feel free to share any further details or error messages you encounter for more tailored assistance.
Reply

Logout Mark Read Team Forum Stats Members Help
Compiling: Build tools and dependencies fails0