Kodi Community Forum
Broken Compiling source for Android - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+--- Thread: Broken Compiling source for Android (/showthread.php?tid=375553)



Compiling source for Android - JohnDoe1999 - 2023-12-27

hi,

Im trying to compile a build for android ARM following the github docs. Im stuck at the last step of 7, however, once I run the last make command I get an error shown below. Help would be very much appreciated.

/home/boaz/kodi-build/build/flatc/src/flatc/include/flatbuffers/flatbuffers.h:357:66: error: ‘Data’ was not declared in this scope
   const T *data() const { return reinterpret_cast<const T *>(Data()); }
                                                                  ^
CMakeFiles/flatc.dir/build.make:215: recipe for target 'CMakeFiles/flatc.dir/src/idl_gen_ts.cpp.o' failed
make[5]: *** [CMakeFiles/flatc.dir/src/idl_gen_ts.cpp.o] Error 1
CMakeFiles/Makefile2:82: recipe for target 'CMakeFiles/flatc.dir/all' failed
make[4]: *** [CMakeFiles/flatc.dir/all] Error 2
Makefile:135: recipe for target 'all' failed
make[3]: *** [all] Error 2
CMakeFiles/flatc.dir/build.make:85: recipe for target 'build/flatc/src/flatc-stamp/flatc-build' failed
make[2]: *** [build/flatc/src/flatc-stamp/flatc-build] Error 2
CMakeFiles/Makefile2:4609: recipe for target 'CMakeFiles/flatc.dir/all' failed
make[1]: *** [CMakeFiles/flatc.dir/all] Error 2
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2


RE: Compiling source for Android - JohnDoe1999 - 2023-12-28

I figured it out, turns out this was caused by outdated compiler packages.

To fix it I used:

code:

$ sudo apt-get install gcc-6 g++-6
$ update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6 --slave /usr/bin/gcov gcov /usr/bin/gcov-6

Thanks to this: https://askubuntu.com/questions/815331/updating-to-latest-gcc-and-g-on-ubuntu-16-04


RE: Compiling source for Android - JohnDoe1999 - 2023-12-28

Solved


RE: Compiling source for Android - JohnDoe1999 - 2023-12-28

I figured it out, turns out this was caused by outdated compiler packages.

To fix it I used:

Code:

$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
$ sudo apt-get update
$ sudo apt-get install gcc-snapshot
$ sudo apt-get install gcc-6 g++-6
$ update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6 --slave /usr/bin/gcov gcov /usr/bin/gcov-6

Thanks to: https://askubuntu.com/questions/815331/updating-to-latest-gcc-and-g-on-ubuntu-16-04


RE: Compiling source for Android - JohnDoe1999 - 2023-12-28

Now I get another error when building the APK Sad

https://paste.kodi.tv/uvikamojic


RE: Compiling source for Android - JohnDoe1999 - 2023-12-28

This has also been resolved, took some hours smashing my head against my keyboard after setting my gradle versions and properties accordingly to my java version.

Turns out I was changing the wrong gradle.properties file, I was changing the file located in:

~/kodi-build/tools/android/packaging

But the correct path is:

~/kodi-build/tools/android/packaging/gradle/wrapper

Furthermore I got another error which had been solved my increasing ram in the first properties path to org.gradle.jvmargs=-Xmx4608m.

Hope this will help others