Category Archives: Android

“Null object reference” exceptions on Android 14 in a QT app

When I switched to QT 6.7.2 and set QT_ANDROID_TARGET_SDK_VERSION "34" (that is Android 14) my QT app started to crash with the following stack traces:

On google Pixel 5 64-bit only 1080x2340 Android 14 (SDK 34) arm64-v8a:

Exception java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
  at android.os.Parcel.createExceptionOrNull (Parcel.java:3189)
  at android.os.Parcel.createException (Parcel.java:3167)
  at android.os.Parcel.readException (Parcel.java:3150)
  at android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:202)
  at android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:154)
  at android.content.ContentProviderProxy.call (ContentProviderNative.java:764)
  at android.content.ContentResolver.call (ContentResolver.java:2466)
  at android.content.ContentResolver.call (ContentResolver.java:2446)
  at ekfr.a (:com.google.android.gms@242013038@24.20.13 (190400-633713831):29)
  at com.google.android.gms.wallet.intentoperation.setupwizard.PaymentsSetupWizardAccountChangeIntentOperation.onHandleIntent (:com.google.android.gms@242013038@24.20.13 (190400-633713831):252)
  at com.google.android.chimera.IntentOperation.onHandleIntent (:com.google.android.gms@242013038@24.20.13 (190400-633713831):2)
  at ajdw.onHandleIntent (:com.google.android.gms@242013038@24.20.13 (190400-633713831):8)
  at pbh.run (:com.google.android.gms@242013038@24.20.13 (190400-633713831):70)
  at pbg.run (:com.google.android.gms@242013038@24.20.13 (190400-633713831):152)
  at elbx.run (:com.google.android.gms@242013038@24.20.13 (190400-633713831):21)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1145)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644)
  at java.lang.Thread.run (Thread.java:1012)
(more…)

Updating Yandex Mobile SDK to version 7.1

QT generates gradle.properties with the following values:

android.useAndroidX=true
android.enableJetifier=true
androidBuildToolsVersion=34.0.0
androidCompileSdkVersion=34
androidNdkVersion=26.2.11394342
buildDir=build
qt5AndroidDir=C:/dev/libs/Qt6/android/release/arm64-v8a/./src/android/java
qtAndroidDir=C:/dev/libs/Qt6/android/release/arm64-v8a/./src/android/java
qtMinSdkVersion=23
qtTargetAbiList=arm64-v8a
qtTargetSdkVersion=33
(more…)

My QT app started to crash on x86_64 Android Emulator

My QT app started to crash on x86_64 Android Emulator with the following stack trace:

03-16 20:56:48.848 15806 15806 I crash_dump64: performing dump of process 15639 (target tid = 15717)
03-16 20:56:48.875 15806 15806 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-16 20:56:48.875 15806 15806 F DEBUG   : Build fingerprint: 'google/sdk_gphone_x86_64/generic_x86_64_arm64:11/RSR1.201211.001/7027799:user/release-keys'
03-16 20:56:48.875 15806 15806 F DEBUG   : Revision: '0'
03-16 20:56:48.875 15806 15806 F DEBUG   : ABI: 'x86_64'
03-16 20:56:48.905 15806 15806 F DEBUG   : Timestamp: 2024-03-16 20:56:48+0300
03-16 20:56:48.905 15806 15806 F DEBUG   : pid: 15639, tid: 15717, name: qtMainLoopThrea  >>> com.domain.MyApp <<<
03-16 20:56:48.905 15806 15806 F DEBUG   : uid: 10154
03-16 20:56:48.906 15806 15806 F DEBUG   : signal 4 (SIGILL), code -6 (SI_TKILL), fault addr --------
03-16 20:56:48.906 15806 15806 F DEBUG   :     rax 0000000000000000  rbx 0000795eb6bbdfe8  rcx 00007964be7b4c87  rdx 0000000000000004
03-16 20:56:48.907 15806 15806 F DEBUG   :     r8  0000000000000001  r9  0000000000000001  r10 00007ffff4f830a8  r11 0000000000000202
03-16 20:56:48.907 15806 15806 F DEBUG   :     r12 0000796216b00050  r13 00007962254b6828  r14 0000000000000000  r15 0000000000000004
03-16 20:56:48.907 15806 15806 F DEBUG   :     rdi 0000000000003d17  rsi 0000000000003d65
03-16 20:56:48.907 15806 15806 F DEBUG   :     rbp 0000795eb6bbceb0  rsp 0000795eb6bbcc78  rip 00007964be7b4c87
03-16 20:56:48.932 15806 15806 F DEBUG   : backtrace:
03-16 20:56:48.932 15806 15806 F DEBUG   :       #00 pc 00000000000b1c87  /apex/com.android.runtime/lib64/bionic/libc.so (tgkill+7) (BuildId: 3707c39fc397eeaa328142d90b50a973)
03-16 20:56:48.932 15806 15806 F DEBUG   :       #01 pc 00000000000faa12  /system/lib64/libndk_translation.so (ndk_translation::Decoder<ndk_translation::SemanticsPlayer<ndk_translation::(anonymous namespace)::Interpreter> >::DecodeSimdScalarTwoRegMisc()+642) (BuildId: 86c2b523febcecc53af82646dc316948)
03-16 20:56:48.932 15806 15806 F DEBUG   :       #02 pc 00000000000f2846  /system/lib64/libndk_translation.so (ndk_translation::Decoder<ndk_translation::SemanticsPlayer<ndk_translation::(anonymous namespace)::Interpreter> >::DecodeDataProcessingSimdAndFp()+2374) (BuildId: 86c2b523febcecc53af82646dc316948)
03-16 20:56:48.932 15806 15806 F DEBUG   :       #03 pc 00000000000eee3a  /system/lib64/libndk_translation.so (ndk_translation::Decoder<ndk_translation::SemanticsPlayer<ndk_translation::(anonymous namespace)::Interpreter> >::Decode(unsigned int)+1114) (BuildId: 86c2b523febcecc53af82646dc316948)
03-16 20:56:48.932 15806 15806 F DEBUG   :       #04 pc 00000000000ee996  /system/lib64/libndk_translation.so (ndk_translation::InterpretInsn(ndk_translation::ProcessState*)+118) (BuildId: 86c2b523febcecc53af82646dc316948)
03-16 20:56:48.932 15806 15806 F DEBUG   :       #05 pc 0000000000123fbe  /system/lib64/libndk_translation.so (BuildId: 86c2b523febcecc53af82646dc316948)
(more…)

Building QT 6.6.2 for Windows and Android

I installed MS Visual Studio, Android Studio and the following tools:

cmake-3.24.2-windows-x86_64
nasm-2.15.05
ninja-win
Python35
Strawberry
VulkanSDK
x86_64-12.2.0-release-win32-seh-rt_v10-rev0

and built QT for Windows with the following commands:

(more…)

Sharing Android phone over TCP with ADB

I was able to share my Android phone over TCP with the following commands:

adb kill-server
start cmd /k adb -a -P 5037 nodaemon server start
(more…)

Building RenderDoc for Android on WSL

I cloned the repository, created build directory, set environment variables and run CMake:

git clone https://github.com/baldurk/renderdoc.git
cd renderdoc/
mkdir build-android
cd build-android
export JAVA_HOME=~/dev/repos/graphicsprofiler/tools/buildtools/jdk
export ANDROID_SDK=~/dev/repos/graphicsprofiler/tools/buildtools/android
export ANDROID_NDK=~/dev/repos/graphicsprofiler/tools/buildtools/android/ndk-bundle/android-ndk-r20b
export PATH=$PATH:$JAVA_HOME/bin
cmake -DBUILD_ANDROID=On -DANDROID_ABI=armeabi-v7a ..
(more…)

Black screen on starting QT Android app

I noticed this about five years ago and hoped that it had passed away, but a few days ago a user reported the following:

(more…)

Yandex Mobile Ads actively crashes on Android

There was an ANR in my Android app, but a few days later Yandex Mobile Ads started to actively crash messing up my statistics:

(more…)

ANR in Yandex Mobile Ads on Android

I got ANR in my Android app on HUAWEI HWJMM (honor 6C Pro) Android 7.0 (SDK 24) with the following stack trace:

  at J.N.M1Y_XVCN (Native method)
  at org.chromium.content.browser.BrowserStartupControllerImpl.b (chromium-Monochrome.aab-stable-<US_SOCIAL_SECURITY_NUMBER>:10)
  at org.chromium.content.browser.BrowserStartupControllerImpl.i (chromium-Monochrome.aab-stable-<US_SOCIAL_SECURITY_NUMBER>:62)
  at hp.run (chromium-Monochrome.aab-stable-<US_SOCIAL_SECURITY_NUMBER>:59)
  at org.chromium.base.ThreadUtils.f (chromium-Monochrome.aab-stable-<US_SOCIAL_SECURITY_NUMBER>:7)
  at org.chromium.android_webview.AwBrowserProcess.l (chromium-Monochrome.aab-stable-<US_SOCIAL_SECURITY_NUMBER>:23)
  at com.android.webview.chromium.M.e (chromium-Monochrome.aab-stable-<US_SOCIAL_SECURITY_NUMBER>:146)
  at com.android.webview.chromium.M.b (chromium-Monochrome.aab-stable-<US_SOCIAL_SECURITY_NUMBER>:172)
  at com.android.webview.chromium.WebViewChromiumFactoryProvider.getWebViewDatabase (chromium-Monochrome.aab-stable-<US_SOCIAL_SECURITY_NUMBER>:7)
  at android.webkit.WebViewDatabase.getInstance (WebViewDatabase.java:38)
  at com.yandex.mobile.ads.impl.e6.a (SourceFile:7)
  at com.yandex.mobile.ads.impl.m60.a (SourceFile:4)
  at com.yandex.mobile.ads.impl.dd.t (SourceFile:1)
  at com.yandex.mobile.ads.impl.dd$a.run (SourceFile:3)
  at android.os.Handler.handleCallback (Handler.java:846)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:205)
  at android.app.ActivityThread.main (ActivityThread.java:6783)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1225)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1086)
(more…)

Google Play Console displays std::exception message

My Android game crashed on a user’s device at the highlighted line:

GameMovement::GameMovement(GameField& field, CellCoord from, CellCoord to) :
    m_field(field),
    pBall(m_field.GetCell(from))
{
    GameGraph graph(&m_field, from, to);

    m_path.reserve(m_field.GetColumnCount() + m_field.GetRowCount());

    if (!graph.FindPath(m_path))
    {
        throw std::runtime_error("Path not found.");
    }

    if (m_path.size() < 2)
    {
        throw std::runtime_error("Wrong path.");
    }
}
(more…)