help with android compilation

Aleksander Kamenik aleksander.kamenik at gmail.com
Wed Nov 17 07:46:04 GMT 2021


Went off list accidentally for a while.

Anyway, as always it was something simple. I was using qt 5.15.x
(which worked fine for Linux desktop build).

However starting with 5.14 something changed in the qt android setup,
e.g in aqt qt-install you don't specify the architecture anymore:

                        android:              Qt 5.14:
android (optional)
                                              Qt 5.13 or below:
android_x86_64, android_arm64_v8a

android_x86, android_armv7

The release notes say this:
On Android, we now added support for multi ABI builds, allowing you to
compile your application for multiple target architectures
in one go. We also added support for the new AAB package format, which
allows deploying of a single package covering all target
architectures in one go to the Google Play Store.

Compiled just fine with qt 5.12.

I'll update the Dockerfile in the github repo soon as well.

Thanks for helping me out Johnny!

On Tue, Nov 9, 2021 at 11:21 AM Johnny Jazeix <jazeix at gmail.com> wrote:
>
> Hi,
>
> Le mar. 9 nov. 2021 à 08:42, Aleksander Kamenik <aleksander.kamenik at gmail.com> a écrit :
>>
>> The new file is present:
>>
>> find /opt/android/ -name new
>> /opt/android/ndk/18.1.5063045/sources/cxx-stl/system/include/new
>> /opt/android/ndk/18.1.5063045/sources/cxx-stl/llvm-libc++/include/new
>> /opt/android/ndk/18.1.5063045/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/7.0.2/include/cuda_wrappers/new
>>
>> I now discovered that at some point in testing using docker I forgot
>> to init and update the git submodules. I do that now and still have a
>> similar error.
>>
>> I updated the https://github.com/kilx/gcompris-docker/blob/main/Dockerfile
>>
>> When running cmake it reports:
>> ---
>> -- You can export a target by specifying
>> -DQTANDROID_EXPORTED_TARGET=<targetname> and -DANDROID_APK_DIR=<paths>
>> -- You can export a target by specifying
>> -DQTANDROID_EXPORTED_TARGET=<targetname> and -DANDROID_APK_DIR=<paths>
>> -- Detecting C compiler ABI info
>> -- Detecting C compiler ABI info - done
>> -- Check for working C compiler:
>> /opt/android/ndk/18.1.5063045/toolchains/llvm/prebuilt/linux-x86_64/bin/clang
>> - skipped
>> -- Detecting C compile features
>> -- Detecting C compile features - done
>> -- Detecting CXX compiler ABI info
>> -- Detecting CXX compiler ABI info - done
>> -- Check for working CXX compiler:
>> /opt/android/ndk/18.1.5063045/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
>> - skipped
>> -- Detecting CXX compile features
>> -- Detecting CXX compile features - done
>> CMake Warning (dev) at
>> /usr/share/ECM/modules/ECMFindModuleHelpers.cmake:112 (message):
>>   Your project should require at least CMake 3.16.0 to use FindKF5.cmake
>> Call Stack (most recent call first):
>>   /usr/share/ECM/find-modules/FindKF5.cmake:30 (ecm_find_package_version_check)
>>   CMakeLists.txt:118 (find_package)
>> This warning is for project developers.  Use -Wno-dev to suppress it.
>>
>> -- Could NOT find KF5DocTools: found neither KF5DocToolsConfig.cmake
>> nor kf5doctools-config.cmake
>> Installing in /usr. Run /opt/build/build_android/prefix.sh to set the
>> environment for gcompris-qt.
>> -- Building build_openssl.sh.in
>> -- Did not find the qml-box2d module in system scope, falling back to
>> submodule build ...
>> -- Found Git: /usr/bin/git (found version "2.32.0")
>> -- Configuring done
>> -- Generating done
>> -- Build files have been written to: /opt/build/build_android
>> ---
>>
>> Note the:
>> ---
>> Did not find the qml-box2d module in system scope, falling back to
>> submodule build ...
>> ---
>>
>> However it is present in gcompris/external.
>>
>
> This is normal. As qml-box2d is not directly installed in the system as a package, it will build it as a submodule.
>
>>
>> Also, is the following warning important? cmake is version 3.18.4 but
>> I don't have the kf5doc* files anywhere.
>> ---
>> CMake Warning (dev) at
>> /usr/share/ECM/modules/ECMFindModuleHelpers.cmake:112 (message):
>>   Your project should require at least CMake 3.16.0 to use FindKF5.cmake
>> Call Stack (most recent call first):
>>   /usr/share/ECM/find-modules/FindKF5.cmake:30 (ecm_find_package_version_check)
>>   CMakeLists.txt:118 (find_package)
>> This warning is for project developers.  Use -Wno-dev to suppress it.
>>
>> -- Could NOT find KF5DocTools: found neither KF5DocToolsConfig.cmake
>> nor kf5doctools-config.cmake
>
>
>
> Not important, it is to build the documentation.
>
>>
>> Installing in /usr. Run /opt/build/build_android/prefix.sh to set the
>> environment for gcompris-qt.
>> ---
>>
>> After running cmake the ./qml_box2d-prefix/src/qml_box2d-build
>> directory is empty.
>>
>> After running make with the following output the Makefile is created though.
>> ---
>> Scanning dependencies of target BuildTranslations
>> [  0%] Built target BuildTranslations
>> Scanning dependencies of target createShareFolders
>> [  0%] Generating shareFolders
>> [  0%] Built target createShareFolders
>> Scanning dependencies of target qml_box2d
>> [  0%] Creating directories for 'qml_box2d'
>> [  0%] No download step for 'qml_box2d'
>> [  0%] No update step for 'qml_box2d'
>> [  0%] No patch step for 'qml_box2d'
>> [  0%] Performing configure step for 'qml_box2d'
>> Info: creating stash file
>> /opt/build/build_android/qml_box2d-prefix/src/qml_box2d-build/.qmake.stash
>> [  1%] Performing build step for 'qml_box2d'
>> ../../../../gcompris/external/qml-box2d/Box2D/Collision/Shapes/b2PolygonShape.cpp:20:10:
>> fatal error: 'new' file not found
>> #include <new>
>>          ^~~~~
>> 1 error generated.
>> make[4]: *** [Makefile.Armeabi-v7a:2697: .obj/b2PolygonShape.o] Error 1
>> make[3]: *** [Makefile:48: armeabi-v7a-all] Error 2
>> make[2]: *** [CMakeFiles/qml_box2d.dir/build.make:130:
>> qml_box2d-prefix/src/qml_box2d-stamp/qml_box2d-build] Error 2
>> make[1]: *** [CMakeFiles/Makefile2:4273: CMakeFiles/qml_box2d.dir/all] Error 2
>> make: *** [Makefile:171: all] Error 2
>> ---
>>
>> However what you mention is not present in that file:
>>
>> grep -Ei 'CXX|llvm|include' ./qml_box2d-prefix/src/qml_box2d-build/Makefile
>> (no result)
>>
>
> This is the issue. For some reason, the compilation of the qml-box2d submodule do not include the default paths.
> I don't really have a clue for now, maybe check the logs to find if there is something wrong?
>
> Johnny
>
>>
>> --
>> Aleksander Kamenik



-- 
Aleksander Kamenik


More information about the GCompris-devel mailing list