Qt for Android known issues: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
(This page is outdated, and the information is now in the official online documentation.)
 
(11 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category:Qt for Android]]
[[Category:Qt for Android]]
== Qt for Android known issues ==
==Qt for Android known issues==
* On Windows, if you encounter issues such as "java.io.IOException: com.android.ide.common.process.ProcessException: Error while executing process D:\Android\Sdk\build-tools\29.0.0\aidl.exe with arguments [...]", then this is most likely due to the path length limitation on Windows. Try using a shorter build path. For example, if you are using Qt Creator, try changing the shadow build directory name to something short.
For known issue with Qt for Android see https://doc.qt.io/qt-6/android-platform-notes.html#known-issues
* If you encounter the error "ld: error: cannot find -lc++" when using Android NDK r20, please install Android NDK r19 instead. This issue has been fixed in upcoming Qt versions. See https://bugreports.qt.io/browse/QTBUG-76293 for more information, as well as a way to temporarily work around the issue in your project settings.
* The Android SDK tools do not work together with Oracle's JDK 9 on Windows. If Qt Creator says your SDK is missing the SDK platform, or if you see errors such as "Android build SDK not defined. Check Android settings." when building a project, install an JDK 8 or earlier.
* Windows has a limitation on path lengths which can cause problems when your project is installed into a location with a very long path name. If you experience FileNotFoundException in openAsset() on startup of your application, try moving it to a directory with a shorter path.
* By default the Back key will terminate Qt for Android apps, unless the key event is accepted. Unfortunately, due to misleading documentation (QTBUG-35155), many applications (including Qt examples) are incorrect, and will block the back key. We recommend making the logic explicit: always ''accept()'' the ''Key_Back'' event, and ''quit()'' the application explicitly if required.


== Issues with older versions ==
*<s>Android API 24+ doesn't support opening intent from URI with file scheme, instead, use a content URI that can be retrieved with a FileProvider ([https://bugreports.qt.io/browse/QTBUG-67877 QTBUG-67877]).</s>
* When running an application for arm64-v8a from Qt Creator, you may encounter the error "clang++.exe: error: no such file or directory: '/path/to/ndk/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++.so.16'". This can be worked around by editing the build environment in the project settings and changing the environment variable ANDROID_NDK_PLATFORM to "android-21"
*<s>In order to work with Qt 5.14.0 and later releases, the AndroidManifest.xml generated for older versions has to be updated. This can be done either by replacing the manifest automatically using Qt Creator, or by manually editing the manifest. An example of the modifications needed can be found in https://codereview.qt-project.org/c/qt/qtandroidextras/+/278987</s>
* There is a bug in GCC in the latest Android NDK, making it impossible to use it for building Qt. For Qt 5.12, the clang toolchain should be used, and is used by the official binary packages. For older versions, please use Android NDK r10e, which does not have the relevant gcc bug. NDK r15 produces applications that fail with the error message 'This application failed to start because it could not find or load the Qt platform plugin "android"'. See also [https://github.com/android-ndk/ndk/issues/67 the bug report].
*<s>By default, the Back key will terminate Qt for Android apps, unless the key event is accepted. Unfortunately, due to misleading documentation ([https://bugreports.qt.io/browse/QTBUG-35155 QTBUG-35155]), many applications (including Qt examples) are incorrect and will block the back key. We recommend making the logic explicit: always ''accept()'' the ''Key_Back'' event, and ''quit()'' the application explicitly if required.</s>
* The Android NDK compiler has [https://code.google.com/p/android/issues/detail?id=58476 a bug when building for armv5 and deploying on older kernels]. This will cause Qt applications to crash on startup. When building Qt, you need to disable 64-bit atomics for armv5. See [https://bugreports.qt.io/browse/QTBUG-52923 QTBUG-52923] for more information.  
 
* Qt Quick 1 apps must be deployed using qrc (QTBUG-32170)
====<s>Windows Host Specific:</s>====
* The Qt Multimedia Widgets module is not supported on Android, which means video display is only available using the ''VideoOutput'' and ''Video'' QML items.
 
* On Kindle Fire 1st generation, there is a limitation on the number of libraries that can be loaded which will lead to shader compilation errors when running some Qt Quick apps. Apps that exhibit this bug will be rejected from being published to the Amazon market. A work-around for the issue is to reduce the number of libraries that are loaded, e.g. by deleting some image format plugins that are not required. See QTBUG-33264 for more information.
*<s>Windows has a limitation on path lengths which can cause problems when your project is installed into a location with a very long path name (260 characters or more). This can be the cause of:</s>
* With the first edition of Samsung XCover 3 (SM-G388F) there appears to be an issue with the graphics driver, causing Qt applications to crash when they are resumed after being suspended. Current investigation points towards a threading issue in the software on the device itself. The issue does not occur with the second edition of the same device, SM-G389F. There is no known work-around for this at the moment, so the recommendation is to blacklist this particular device model in Google Play. Setting the QML_BAD_GUI_RENDER_LOOP environment variable to 1 will make the crash less likely to occur. QTBUG-55392
**<s>FileNotFoundException in openAsset() on the startup of your application, try moving it to a directory with a shorter path.</s>
* There are issues with the updated Android SDK which makes it impossible to use it together with earlier versions of Qt for Android. This has been fixed in Qt 5.9.0, but for older versions, it is possible to use the following links to download a working version of the SDK (do not update the SDK after downloading): [https://dl.google.com/android/repository/tools_r25.2.5-macosx.zip macOS] [https://dl.google.com/android/repository/tools_r25.2.5-windows.zip Windows] and [https://dl.google.com/android/repository/tools_r25.2.5-linux.zip Linux].
**<s>"java.io.IOException: com.android.ide.common.process.ProcessException: Error while executing process D:\Android\Sdk\build-tools\29.0.0\aidl.exe with arguments [...]".</s>
*<s>The Android SDK tools do not work together with Oracle's JDK 9 on Windows. If Qt Creator says your SDK is missing the SDK platform, or if you see errors such as "Android build SDK not defined. Check Android settings." when building a project, install a JDK 8 or earlier.</s>
 
==<s>Issues with Qt 5.12.4 and earlier</s>==
 
*<s>If you encounter the error "ld: error: cannot find -lc++" when using Android NDK r20, please install Android NDK r19 instead. This issue has been fixed in upcoming Qt versions. See [https://bugreports.qt.io/browse/QTBUG-76293 QTBUG-76293] for more information, as well as a way to temporarily work around the issue in your project settings.</s>
*<s>When running an application for arm64-v8a from Qt Creator, you may encounter the error "clang++.exe: error: no such file or directory: '/path/to/ndk/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++.so.16'". This can be worked around by editing the built environment in the project settings and changing the environment variable ANDROID_NDK_PLATFORM to "android-21"</s>
*<s>There is a bug in GCC in the latest Android NDK, making it impossible to use it for building Qt. For Qt 5.12, the clang toolchain should be used and is used by the official binary packages. For older versions, please use Android NDK r10e, which does not have the relevant GCC bug. NDK r15 produces applications that fail with the error message 'This application failed to start because it could not find or load the Qt platform plugin "android"'. See also [https://github.com/android-ndk/ndk/issues/67 the bug report].</s>
*<s>The Android NDK compiler has [https://code.google.com/p/android/issues/detail?id=58476 a bug when building for armv5 and deploying on older kernels]. This will cause Qt applications to crash on startup. When building Qt, you need to disable 64-bit atomics for armv5. See [https://bugreports.qt.io/browse/QTBUG-52923 QTBUG-52923] for more information.</s>
*<s>Qt Quick 1 apps must be deployed using qrc ([https://bugreports.qt.io/browse/QTBUG-32170 QTBUG-32170])</s>
*<s>The Qt Multimedia Widgets module is not supported on Android, which means video display is only available using the ''VideoOutput'' and ''Video'' QML items.</s>
*<s>On Kindle Fire 1st generation, there is a limitation on the number of libraries that can be loaded which will lead to shader compilation errors when running some Qt Quick apps. Apps that exhibit this bug will be rejected from being published to the Amazon market. A work-around for the issue is to reduce the number of libraries that are loaded, e.g. by deleting some image format plugins that are not required. See [https://bugreports.qt.io/browse/QTBUG-33264 QTBUG-33264] for more information.</s>
*<s>With the first edition of Samsung XCover 3 (SM-G388F), there appears to be an issue with the graphics driver, causing Qt applications to crash when they are resumed after being suspended. The current investigation points towards a threading issue in the software on the device itself. The issue does not occur with the second edition of the same device, SM-G389F. There is no known workaround for this at the moment, so the recommendation is to blacklist this particular device model in Google Play. Setting the QML_BAD_GUI_RENDER_LOOP environment variable to 1 will make the crash less likely to occur. See [https://bugreports.qt.io/browse/QTBUG-55392 QTBUG-55392].</s>
*<s>There are issues with the updated Android SDK which makes it impossible to use it together with earlier versions of Qt for Android. This has been fixed in Qt 5.9.0, but for older versions, it is possible to use the following links to download a working version of the SDK (do not update the SD</s>K after downloading): [https://dl.google.com/android/repository/tools_r25.2.5-macosx.zip macOS] [https://dl.google.com/android/repository/tools_r25.2.5-windows.zip Windows] and [https://dl.google.com/android/repository/tools_r25.2.5-linux.zip Linux].

Latest revision as of 09:26, 30 March 2023

Qt for Android known issues

For known issue with Qt for Android see https://doc.qt.io/qt-6/android-platform-notes.html#known-issues

  • Android API 24+ doesn't support opening intent from URI with file scheme, instead, use a content URI that can be retrieved with a FileProvider (QTBUG-67877).
  • In order to work with Qt 5.14.0 and later releases, the AndroidManifest.xml generated for older versions has to be updated. This can be done either by replacing the manifest automatically using Qt Creator, or by manually editing the manifest. An example of the modifications needed can be found in https://codereview.qt-project.org/c/qt/qtandroidextras/+/278987
  • By default, the Back key will terminate Qt for Android apps, unless the key event is accepted. Unfortunately, due to misleading documentation (QTBUG-35155), many applications (including Qt examples) are incorrect and will block the back key. We recommend making the logic explicit: always accept() the Key_Back event, and quit() the application explicitly if required.

Windows Host Specific:

  • Windows has a limitation on path lengths which can cause problems when your project is installed into a location with a very long path name (260 characters or more). This can be the cause of:
    • FileNotFoundException in openAsset() on the startup of your application, try moving it to a directory with a shorter path.
    • "java.io.IOException: com.android.ide.common.process.ProcessException: Error while executing process D:\Android\Sdk\build-tools\29.0.0\aidl.exe with arguments [...]".
  • The Android SDK tools do not work together with Oracle's JDK 9 on Windows. If Qt Creator says your SDK is missing the SDK platform, or if you see errors such as "Android build SDK not defined. Check Android settings." when building a project, install a JDK 8 or earlier.

Issues with Qt 5.12.4 and earlier

  • If you encounter the error "ld: error: cannot find -lc++" when using Android NDK r20, please install Android NDK r19 instead. This issue has been fixed in upcoming Qt versions. See QTBUG-76293 for more information, as well as a way to temporarily work around the issue in your project settings.
  • When running an application for arm64-v8a from Qt Creator, you may encounter the error "clang++.exe: error: no such file or directory: '/path/to/ndk/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++.so.16'". This can be worked around by editing the built environment in the project settings and changing the environment variable ANDROID_NDK_PLATFORM to "android-21"
  • There is a bug in GCC in the latest Android NDK, making it impossible to use it for building Qt. For Qt 5.12, the clang toolchain should be used and is used by the official binary packages. For older versions, please use Android NDK r10e, which does not have the relevant GCC bug. NDK r15 produces applications that fail with the error message 'This application failed to start because it could not find or load the Qt platform plugin "android"'. See also the bug report.
  • The Android NDK compiler has a bug when building for armv5 and deploying on older kernels. This will cause Qt applications to crash on startup. When building Qt, you need to disable 64-bit atomics for armv5. See QTBUG-52923 for more information.
  • Qt Quick 1 apps must be deployed using qrc (QTBUG-32170)
  • The Qt Multimedia Widgets module is not supported on Android, which means video display is only available using the VideoOutput and Video QML items.
  • On Kindle Fire 1st generation, there is a limitation on the number of libraries that can be loaded which will lead to shader compilation errors when running some Qt Quick apps. Apps that exhibit this bug will be rejected from being published to the Amazon market. A work-around for the issue is to reduce the number of libraries that are loaded, e.g. by deleting some image format plugins that are not required. See QTBUG-33264 for more information.
  • With the first edition of Samsung XCover 3 (SM-G388F), there appears to be an issue with the graphics driver, causing Qt applications to crash when they are resumed after being suspended. The current investigation points towards a threading issue in the software on the device itself. The issue does not occur with the second edition of the same device, SM-G389F. There is no known workaround for this at the moment, so the recommendation is to blacklist this particular device model in Google Play. Setting the QML_BAD_GUI_RENDER_LOOP environment variable to 1 will make the crash less likely to occur. See QTBUG-55392.
  • There are issues with the updated Android SDK which makes it impossible to use it together with earlier versions of Qt for Android. This has been fixed in Qt 5.9.0, but for older versions, it is possible to use the following links to download a working version of the SDK (do not update the SDK after downloading): macOS Windows and Linux.