What's the problem? android compile error
-
Hi,
I have exactly the same issue. Google Play Console requires adaptation for android-28 and arm64-v8a
from August 19, so QT developers cannot use r16b anymore and I have used NDK r20 instead. Unfortunatelly I received -lc++ library linking problem. I am not sure why, because the library is available in the expected path, and objdump returns correct armv7 architecture.To solve the issue with linking I just used android-ndk-19c version. But note, that the 19c contains some bug with support of spaces in the QRC paths, so for example I had to remove this from the QRC:
make[1]: *** No rule to make target '/project/fonts/customfont/pobrano z /project/fonts/customfont/koikj.txt', needed by 'qrc_qml.cpp'. Stop
-
The error: cannot find -lc++ using ndk r20 can be solved like this:
https://codereview.qt-project.org/c/qt/qtbase/+/264903/9/mkspecs/android-clang/qmake.conf#34For example to compile for android armv7 ndk r20, locate the file:
C:\Qt\5.13.0\android_armv7\mkspecs\android-clang\qmake.conf
and add the missing-nostdlib++
for android x86 (i use this for emulator), locate the file:
C:\Qt\5.13.0\android_x86\mkspecs\android-clang\qmake.conf
For error:
Execution failed for task ':compileDebugAidl'
locate the file on your build directory, mine is:C:\dev_qt\experiments\build-test_qt_5_13_0_ARMv7-Release\android-build\gradle.properties
and changeandroidBuildToolsVersion
from:androidBuildToolsVersion=29.0.0
to:androidBuildToolsVersion=28.0.3
-
@Albertino Thank your very much. Now I can build and run the calculator example project with the emulator. That's very motivating. However I get many warnings in the log. Maybe the example projects are not optimized for Android. I will check the tutorial a hallo world project.
I zygote : Not late-enabling -Xcheck:jni (already on) W zygote : Unexpected CPU variant for X86 using defaults: x86 W System : ClassLoader referenced unknown path: I QtCore : Start W linker : "/data/app/org.qtproject.example.calculator-LvUUU6gyNuONt6Duq8qL_A==/lib/x86/libQt5Gui.so" has unsupported flags DT_FLAGS_1=0x80 W linker : "/data/app/org.qtproject.example.calculator-LvUUU6gyNuONt6Duq8qL_A==/lib/x86/libQt5Widgets.so" has unsupported flags DT_FLAGS_1=0x80 W linker : "/data/data/org.qtproject.example.calculator/qt-reserved-files/plugins/platforms/android/libqtforandroid.so" has unsupported flags DT_FLAGS_1=0x80 I Qt : qt started D OpenGLRenderer: HWUI GL Pipeline I zygote : Background concurrent copying GC freed 14726(1133KB) AllocSpace objects, 18(380KB) LOS objects, 52% free, 1407KB/2MB, paused 741us total 254.773ms I zygote : Do partial code cache collection, code=26KB, data=30KB I zygote : After code cache collection, code=25KB, data=30KB I zygote : Increasing code cache capacity to 128KB I zygote : Background concurrent copying GC freed 14025(1072KB) AllocSpace objects, 20(512KB) LOS objects, 50% free, 1491KB/2MB, paused 53.091ms total 112.459ms I zygote : Do partial code cache collection, code=50KB, data=56KB I zygote : After code cache collection, code=48KB, data=55KB I zygote : Increasing code cache capacity to 256KB D : HostConnection::get() New Host Connection established 0x9a107280, tid 5700 I zygote : android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0 I OpenGLRenderer: Initialized EGL, version 1.4 D OpenGLRenderer: Swap behavior 1 W OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without... D OpenGLRenderer: Swap behavior 0
-
This post is deleted!
-
@ali-aydin said in What's the problem? android compile error:
where is " theQT project/app's folder
It's you project folder where the source code is.