Re: [Qbs] Issues building for Android
ons. 14. okt. 2020 kl. 21:03 skrev Raphael Cotty : > Hi, > Just tried the Qt Quick wizard. If you change the CppApplication into > QtGuiApplication then it works (instead of QtApplication). > > Thanks again everyone. So, my previous build error was eliminated by wiping the build directory completely and starting from scratch. Maybe something is not cleaned up properly in the build directory even when doing clean rebuild (stuff created from the android tools, not the c++ compiler). Googling the internet for the "duplicate class" problem turned up some others having that issue that aren't using Qbs, recommending just wiping all build artifacts. Starting everything from scratch but with a QtApplication didn't work for me, I needed to set those two extra properties in the Qbs profile manually. But then it works! Finally, my app runs on the target Android device. Summary: - Clean install of QtCreator letting it set up Android SDK/NDK doesn't quite work, might need to set the two additional Qbs properties in the kit manually. In my case: Android.sdk.buildToolsVersion: 29.0.2 Android.sdk.platform: android-29 - Use QtApplication, not CppApplication. The QtCreator-wizard could need this change to avoid more confusion. Reported it here: https://bugreports.qt.io/browse/QTCREATORBUG-24783 - There might be some cleanup-issue in the build artifacts when messing around like I just did, causing the duplicate class error. Quick fix was to delete the whole build directory and try again. - Qt 5.15.x does not work for Android with Qbs yet, so I'll stick with Qt 5.14. Best regards, Ola ___ Qbs mailing list Qbs@qt-project.org https://lists.qt-project.org/listinfo/qbs
Re: [Qbs] Issues building for Android
Hi, Just tried the Qt Quick wizard. If you change the CppApplication into QtGuiApplication then it works (instead of QtApplication). Raph Le mer. 14 oct. 2020 à 20:45, Ola Røer Thorsen a écrit : > ons. 14. okt. 2020 kl. 19:55 skrev Richard Weickelt : > > >> Qt Creator is not part of the tests. We run everything with Qbs only on >> the >> command line in a Docker image. >> >> > Thanks!! > > Some progress now: first, if I set these two additional properties in the > Qbs-part of the kit, I get further building: > Android.sdk.buildToolsVersion: 29.0.2 > Android.sdk.platform: android-29 > > These two were empty when checking them for the kit used, so the build > part calling "aidl" failed. > > Also, the Qt Creator wizard setting up an empty Qt Quick project for Qbs > creates it with a CppApplication item, depending only on Qt.quick. This > caused a further problem "cannot find application binary". Fixed by using > the QtApplication item instead (just depending on Qt.core does not help). > > Now, the build fails because "Some input files use or override a > deprecated API" (I'll paste the build output below...) > > Best regards, > Ola > > > > Generating Android Package > Input file: > /home/olathorsen/src/build-androidtest-Android_Qt_5_14_2_Clang_Multi_Abi-Release/Release_Android__97aac75243e7a13e/androidtest.48600a3e/androiddeployqt.json > Output directory: > /home/olathorsen/src/build-androidtest-Android_Qt_5_14_2_Clang_Multi_Abi-Release/Release_Android__97aac75243e7a13e/androidtest.48600a3e/deployqt_out/ > Application binary: androidtest > Android build platform: android-29 > Install to device: No > -- Skipping > /home/olathorsen/Qt/5.14.2/android/plugins/iconengines/libplugins_iconengines_qsvgicon_arm64-v8a.so. > It has unmet dependencies: > lib/libQt5Svg_arm64-v8a.so,lib/libQt5Widgets_arm64-v8a.so. > -- Skipping > /home/olathorsen/Qt/5.14.2/android/plugins/imageformats/libplugins_imageformats_qsvg_arm64-v8a.so. > It has unmet dependencies: > lib/libQt5Svg_arm64-v8a.so,lib/libQt5Widgets_arm64-v8a.so. > -- Skipping > /home/olathorsen/Qt/5.14.2/android/plugins/iconengines/libplugins_iconengines_qsvgicon_x86_64.so. > It has unmet dependencies: > lib/libQt5Svg_x86_64.so,lib/libQt5Widgets_x86_64.so. > -- Skipping > /home/olathorsen/Qt/5.14.2/android/plugins/imageformats/libplugins_imageformats_qsvg_x86_64.so. > It has unmet dependencies: > lib/libQt5Svg_x86_64.so,lib/libQt5Widgets_x86_64.so. > -- Skipping > /home/olathorsen/Qt/5.14.2/android/plugins/iconengines/libplugins_iconengines_qsvgicon_armeabi-v7a.so. > It has unmet dependencies: > lib/libQt5Svg_armeabi-v7a.so,lib/libQt5Widgets_armeabi-v7a.so. > -- Skipping > /home/olathorsen/Qt/5.14.2/android/plugins/imageformats/libplugins_imageformats_qsvg_armeabi-v7a.so. > It has unmet dependencies: > lib/libQt5Svg_armeabi-v7a.so,lib/libQt5Widgets_armeabi-v7a.so. > -- Skipping > /home/olathorsen/Qt/5.14.2/android/plugins/iconengines/libplugins_iconengines_qsvgicon_x86.so. > It has unmet dependencies: lib/libQt5Svg_x86.so,lib/libQt5Widgets_x86.so. > -- Skipping > /home/olathorsen/Qt/5.14.2/android/plugins/imageformats/libplugins_imageformats_qsvg_x86.so. > It has unmet dependencies: lib/libQt5Svg_x86.so,lib/libQt5Widgets_x86.so. > processing androiddeployqt outout [androidtest] > Stripping unneeded symbols from deployed qt libraries [androidtest] > processing resources [androidtest] > Error: Process '/usr/lib/jvm/java-8-openjdk-amd64/bin/java' finished with > exit code 1. The standard output was: > [ > ] > The standard error output was: > /home/olathorsen/src/build-androidtest-Android_Qt_5_14_2_Clang_Multi_Abi-Release/Release_Android__97aac75243e7a13e/androidtest.48600a3e/gen/com/example/androidtest/BuildConfig.java:2: > error: duplicate class: com.example.androidtest.BuildConfig > public final class BuildConfig { > ^ > Note: Some input files use or override a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > 1 error > > The following products could not be built for configuration > Release_Android__97aac75243e7a13e: > androidtest > > > > > > ___ > Qbs mailing list > Qbs@qt-project.org > https://lists.qt-project.org/listinfo/qbs > ___ Qbs mailing list Qbs@qt-project.org https://lists.qt-project.org/listinfo/qbs
Re: [Qbs] Issues building for Android
Hi, The error comes from this: home/olathorsen/src/build-androidtest-Android_Qt_5_14_2_Clang_Multi_Abi-Release/Release_Android__97aac75243e7a13e/androidtest.48600a3e/gen/com/example/androidtest/BuildConfig.java:2: error: duplicate class: com.example.androidtest.BuildConfig Can you send your project? Raph Le mer. 14 oct. 2020 à 20:45, Ola Røer Thorsen a écrit : > ons. 14. okt. 2020 kl. 19:55 skrev Richard Weickelt : > > >> Qt Creator is not part of the tests. We run everything with Qbs only on >> the >> command line in a Docker image. >> >> > Thanks!! > > Some progress now: first, if I set these two additional properties in the > Qbs-part of the kit, I get further building: > Android.sdk.buildToolsVersion: 29.0.2 > Android.sdk.platform: android-29 > > These two were empty when checking them for the kit used, so the build > part calling "aidl" failed. > > Also, the Qt Creator wizard setting up an empty Qt Quick project for Qbs > creates it with a CppApplication item, depending only on Qt.quick. This > caused a further problem "cannot find application binary". Fixed by using > the QtApplication item instead (just depending on Qt.core does not help). > > Now, the build fails because "Some input files use or override a > deprecated API" (I'll paste the build output below...) > > Best regards, > Ola > > > > Generating Android Package > Input file: > /home/olathorsen/src/build-androidtest-Android_Qt_5_14_2_Clang_Multi_Abi-Release/Release_Android__97aac75243e7a13e/androidtest.48600a3e/androiddeployqt.json > Output directory: > /home/olathorsen/src/build-androidtest-Android_Qt_5_14_2_Clang_Multi_Abi-Release/Release_Android__97aac75243e7a13e/androidtest.48600a3e/deployqt_out/ > Application binary: androidtest > Android build platform: android-29 > Install to device: No > -- Skipping > /home/olathorsen/Qt/5.14.2/android/plugins/iconengines/libplugins_iconengines_qsvgicon_arm64-v8a.so. > It has unmet dependencies: > lib/libQt5Svg_arm64-v8a.so,lib/libQt5Widgets_arm64-v8a.so. > -- Skipping > /home/olathorsen/Qt/5.14.2/android/plugins/imageformats/libplugins_imageformats_qsvg_arm64-v8a.so. > It has unmet dependencies: > lib/libQt5Svg_arm64-v8a.so,lib/libQt5Widgets_arm64-v8a.so. > -- Skipping > /home/olathorsen/Qt/5.14.2/android/plugins/iconengines/libplugins_iconengines_qsvgicon_x86_64.so. > It has unmet dependencies: > lib/libQt5Svg_x86_64.so,lib/libQt5Widgets_x86_64.so. > -- Skipping > /home/olathorsen/Qt/5.14.2/android/plugins/imageformats/libplugins_imageformats_qsvg_x86_64.so. > It has unmet dependencies: > lib/libQt5Svg_x86_64.so,lib/libQt5Widgets_x86_64.so. > -- Skipping > /home/olathorsen/Qt/5.14.2/android/plugins/iconengines/libplugins_iconengines_qsvgicon_armeabi-v7a.so. > It has unmet dependencies: > lib/libQt5Svg_armeabi-v7a.so,lib/libQt5Widgets_armeabi-v7a.so. > -- Skipping > /home/olathorsen/Qt/5.14.2/android/plugins/imageformats/libplugins_imageformats_qsvg_armeabi-v7a.so. > It has unmet dependencies: > lib/libQt5Svg_armeabi-v7a.so,lib/libQt5Widgets_armeabi-v7a.so. > -- Skipping > /home/olathorsen/Qt/5.14.2/android/plugins/iconengines/libplugins_iconengines_qsvgicon_x86.so. > It has unmet dependencies: lib/libQt5Svg_x86.so,lib/libQt5Widgets_x86.so. > -- Skipping > /home/olathorsen/Qt/5.14.2/android/plugins/imageformats/libplugins_imageformats_qsvg_x86.so. > It has unmet dependencies: lib/libQt5Svg_x86.so,lib/libQt5Widgets_x86.so. > processing androiddeployqt outout [androidtest] > Stripping unneeded symbols from deployed qt libraries [androidtest] > processing resources [androidtest] > Error: Process '/usr/lib/jvm/java-8-openjdk-amd64/bin/java' finished with > exit code 1. The standard output was: > [ > ] > The standard error output was: > /home/olathorsen/src/build-androidtest-Android_Qt_5_14_2_Clang_Multi_Abi-Release/Release_Android__97aac75243e7a13e/androidtest.48600a3e/gen/com/example/androidtest/BuildConfig.java:2: > error: duplicate class: com.example.androidtest.BuildConfig > public final class BuildConfig { > ^ > Note: Some input files use or override a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > 1 error > > The following products could not be built for configuration > Release_Android__97aac75243e7a13e: > androidtest > > > > > > ___ > Qbs mailing list > Qbs@qt-project.org > https://lists.qt-project.org/listinfo/qbs > ___ Qbs mailing list Qbs@qt-project.org https://lists.qt-project.org/listinfo/qbs
Re: [Qbs] Issues building for Android
ons. 14. okt. 2020 kl. 19:55 skrev Richard Weickelt : > Qt Creator is not part of the tests. We run everything with Qbs only on the > command line in a Docker image. > > Thanks!! Some progress now: first, if I set these two additional properties in the Qbs-part of the kit, I get further building: Android.sdk.buildToolsVersion: 29.0.2 Android.sdk.platform: android-29 These two were empty when checking them for the kit used, so the build part calling "aidl" failed. Also, the Qt Creator wizard setting up an empty Qt Quick project for Qbs creates it with a CppApplication item, depending only on Qt.quick. This caused a further problem "cannot find application binary". Fixed by using the QtApplication item instead (just depending on Qt.core does not help). Now, the build fails because "Some input files use or override a deprecated API" (I'll paste the build output below...) Best regards, Ola Generating Android Package Input file: /home/olathorsen/src/build-androidtest-Android_Qt_5_14_2_Clang_Multi_Abi-Release/Release_Android__97aac75243e7a13e/androidtest.48600a3e/androiddeployqt.json Output directory: /home/olathorsen/src/build-androidtest-Android_Qt_5_14_2_Clang_Multi_Abi-Release/Release_Android__97aac75243e7a13e/androidtest.48600a3e/deployqt_out/ Application binary: androidtest Android build platform: android-29 Install to device: No -- Skipping /home/olathorsen/Qt/5.14.2/android/plugins/iconengines/libplugins_iconengines_qsvgicon_arm64-v8a.so. It has unmet dependencies: lib/libQt5Svg_arm64-v8a.so,lib/libQt5Widgets_arm64-v8a.so. -- Skipping /home/olathorsen/Qt/5.14.2/android/plugins/imageformats/libplugins_imageformats_qsvg_arm64-v8a.so. It has unmet dependencies: lib/libQt5Svg_arm64-v8a.so,lib/libQt5Widgets_arm64-v8a.so. -- Skipping /home/olathorsen/Qt/5.14.2/android/plugins/iconengines/libplugins_iconengines_qsvgicon_x86_64.so. It has unmet dependencies: lib/libQt5Svg_x86_64.so,lib/libQt5Widgets_x86_64.so. -- Skipping /home/olathorsen/Qt/5.14.2/android/plugins/imageformats/libplugins_imageformats_qsvg_x86_64.so. It has unmet dependencies: lib/libQt5Svg_x86_64.so,lib/libQt5Widgets_x86_64.so. -- Skipping /home/olathorsen/Qt/5.14.2/android/plugins/iconengines/libplugins_iconengines_qsvgicon_armeabi-v7a.so. It has unmet dependencies: lib/libQt5Svg_armeabi-v7a.so,lib/libQt5Widgets_armeabi-v7a.so. -- Skipping /home/olathorsen/Qt/5.14.2/android/plugins/imageformats/libplugins_imageformats_qsvg_armeabi-v7a.so. It has unmet dependencies: lib/libQt5Svg_armeabi-v7a.so,lib/libQt5Widgets_armeabi-v7a.so. -- Skipping /home/olathorsen/Qt/5.14.2/android/plugins/iconengines/libplugins_iconengines_qsvgicon_x86.so. It has unmet dependencies: lib/libQt5Svg_x86.so,lib/libQt5Widgets_x86.so. -- Skipping /home/olathorsen/Qt/5.14.2/android/plugins/imageformats/libplugins_imageformats_qsvg_x86.so. It has unmet dependencies: lib/libQt5Svg_x86.so,lib/libQt5Widgets_x86.so. processing androiddeployqt outout [androidtest] Stripping unneeded symbols from deployed qt libraries [androidtest] processing resources [androidtest] Error: Process '/usr/lib/jvm/java-8-openjdk-amd64/bin/java' finished with exit code 1. The standard output was: [ ] The standard error output was: /home/olathorsen/src/build-androidtest-Android_Qt_5_14_2_Clang_Multi_Abi-Release/Release_Android__97aac75243e7a13e/androidtest.48600a3e/gen/com/example/androidtest/BuildConfig.java:2: error: duplicate class: com.example.androidtest.BuildConfig public final class BuildConfig { ^ Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 1 error The following products could not be built for configuration Release_Android__97aac75243e7a13e: androidtest ___ Qbs mailing list Qbs@qt-project.org https://lists.qt-project.org/listinfo/qbs
Re: [Qbs] Issues building for Android
Hi, QtCreator manages the qbs configuration (in $HOME/.config/QtProjects/qtcreator/qbs/). In Options / Devices / Android widget you should be able to check if qtc is ok with your sdk and ndk. If you select a different path for your sdk/ndk then the qbs profile is/should be updated (not sure if it works properly). Raph Le mer. 14 oct. 2020 à 18:59, Ola Røer Thorsen a écrit : > man. 12. okt. 2020 kl. 20:34 skrev Raphael Cotty >: > >> Hi, >> Looks like your android profile is not correct. >> > > Agreed. (It was set up automatically by QtCreator). > > >> What do you have for the sdkDir/ndkDir keys? >> Are they pointing to the android sdk/ndk? >> > > Android.sdk.sdkDir: /home//Android/Sdk > Android.ndk.ndkDir: /home//Android/Sdk/ndk/21.1.6352462 > (these paths exist) > > I now also tried to build using Qt 5.14.2, but no change (still problems > starting with not finding the aidl tool). > > Seems like something is broken where the kit is set up, as the > Android.sdk.buildToolsVersion is not set. > > Is a clean install of Qt, QtCreator + QtCreator setting up the Android > SDK/NDK a part of the CI for Qbs? > > If anyone can share a complete and working android profile here, then I > can try to fill in the blanks in the QtCreator kit. > > Best regards, > Ola > > > > > ___ > Qbs mailing list > Qbs@qt-project.org > https://lists.qt-project.org/listinfo/qbs > ___ Qbs mailing list Qbs@qt-project.org https://lists.qt-project.org/listinfo/qbs
Re: [Qbs] Issues building for Android
> I now also tried to build using Qt 5.14.2, but no change (still problems > starting with not finding the aidl tool). > > Seems like something is broken where the kit is set up, as the > Android.sdk.buildToolsVersion is not set. > > Is a clean install of Qt, QtCreator + QtCreator setting up the Android > SDK/NDK a part of the CI for Qbs? Qt Creator is not part of the tests. We run everything with Qbs only on the command line in a Docker image. Our jobs can be found here: https://code.qt.io/cgit/qbs/qbs.git/tree/.github/workflows/main.yml Example test job (Qt for Android 5.14): https://github.com/rweickelt/qbs/runs/1253245655 Docker image with Android SDK/NDK installed: https://code.qt.io/cgit/qbs/qbs.git/tree/docker/focal/test-android.Dockerfile > If anyone can share a complete and working android profile here, then I can > try to fill in the blanks in the QtCreator kit. The result of running qbs setup-android --ndk-dir ${ANDROID_HOME}/ndk-bundle --sdk-dir ${ANDROID_HOME} --qt-dir ${QT_INSTALL_DIR} qbs_autotests-android-qt is this: profiles.qbs_autotests-android-qt.Android.ndk.ndkDir: "/home/devel/android/ndk-bundle" profiles.qbs_autotests-android-qt.Android.ndk.platform: "android-21" profiles.qbs_autotests-android-qt.Android.sdk.ndkDir: "/home/devel/android/ndk-bundle" profiles.qbs_autotests-android-qt.Android.sdk.sdkDir: "/home/devel/android" profiles.qbs_autotests-android-qt.moduleProviders.Qt.qmakeFilePaths: "/opt/Qt/5.14.0/android/bin/qmake" profiles.qbs_autotests-android-qt.qbs.architecture: ["armv7a", "x86_64"] profiles.qbs_autotests-android-qt.qbs.targetPlatform: "android" profiles.qbs_autotests-android-qt.qbs.toolchainType: "clang" Taken from the linked job above. Richard ___ Qbs mailing list Qbs@qt-project.org https://lists.qt-project.org/listinfo/qbs
Re: [Qbs] Issues building for Android
man. 12. okt. 2020 kl. 20:34 skrev Raphael Cotty : > Hi, > Looks like your android profile is not correct. > Agreed. (It was set up automatically by QtCreator). > What do you have for the sdkDir/ndkDir keys? > Are they pointing to the android sdk/ndk? > Android.sdk.sdkDir: /home//Android/Sdk Android.ndk.ndkDir: /home//Android/Sdk/ndk/21.1.6352462 (these paths exist) I now also tried to build using Qt 5.14.2, but no change (still problems starting with not finding the aidl tool). Seems like something is broken where the kit is set up, as the Android.sdk.buildToolsVersion is not set. Is a clean install of Qt, QtCreator + QtCreator setting up the Android SDK/NDK a part of the CI for Qbs? If anyone can share a complete and working android profile here, then I can try to fill in the blanks in the QtCreator kit. Best regards, Ola ___ Qbs mailing list Qbs@qt-project.org https://lists.qt-project.org/listinfo/qbs