Build Krita for Android version, error with ext_qt

I want to build Android version krita with latest code on master branch.
When I build ext_qt module, the error happened.

[ 0%] **Performing build step for 'ext_qt'**
error: Source option 6 is no longer supported. Use 7 or later.
error: Target option 6 is no longer supported. Use 7 or later.
make[8]: *** [.classes] Error 2
make[7]: *** [sub-jar-make_first-ordered] Error 2
make[6]: *** [sub--Users-wyr-Desktop-krita-build-krita-android-b-ext_qt-ext_qt-prefix-src-ext_qt-qtbase-src-android-make_first] Error 2
make[6]: *** Waiting for unfinished jobs....
access/qnetworkaccessdebugpipebackend_p.h:0: Note: No relevant classes found. No output generated.
make[5]: *** [sub-src-make_first] Error 2
make[4]: *** [module-qtbase-make_first] Error 2
make[3]: *** [ext_qt/ext_qt-prefix/src/ext_qt-stamp/ext_qt-build] Error 2
make[2]: *** [ext_qt/CMakeFiles/ext_qt.dir/all] Error 2
make[1]: *** [ext_qt/CMakeFiles/ext_qt.dir/rule] Error 2
make: *** [ext_qt] Error 2

I have read the CMakeLists.txt in ext_qt folder but still don’t know how to solve the problem.
Do anyone has encountered the same problem?
Thanks!!!

No, I’ve never encountered this error with ext_qt. But it looks like your JDK is incompatible with ancient one Qt expects.

Try to up this number manually https://github.com/sh-zam/qtbase/blob/5.12.9/mkspecs/features/java.prf#L23 and rerun cmake --build . --config $BUILD_TYPE --target ext_qt

Thank you! I have tried to change my jdk version to jdk8, it seems works.

Now I have built Krita’s .so files for Android succeed. But there’s another problem. The terminal log is as follows.

Generating krita with /Users/eukky/Desktop/krita/build-krita-android/i/bin/androiddeployqt
CMake Error at i/share/ECM/toolchain/specifydependencies.cmake:4 (message):
  readelf failed on
  /Users/eukky/Desktop/krita/build-krita-android/lib/libkrita.so exit(No such
  file or directory):


make[3]: *** [CMakeFiles/create-apk-krita] Error 1
make[2]: *** [CMakeFiles/create-apk-krita.dir/all] Error 2
make[1]: *** [CMakeFiles/create-apk.dir/rule] Error 2
make: *** [create-apk] Error 2

I have checked the libkrita.so file is exist and don’t really know why the problem has happened.

How exactly are you building the APK? Did you manually run make create-apk?

I just use the androidbuild.sh script to build the APK. And I set -p=all to build android apk

Wait, is this MacOS?

Yes, My system version is MacOS 10.15.7

Outch!

We use KDE’s extra-cmake-modules (ECM) to get dependencies out of ELF binaries, for that it uses readelf. I believe this readelf doesn’t exist in your on your PC.

So, you’d have to hack the ECM to use the one bundled with Android (which should be a prebuilt Mach-O binary). Or just link link readelf in one of your $PATH directories to one in android-ndk’s prebuilts (usually at $ndk/toolchains/llvm/prebuilt/*/bin/).