From 054dfb50a0c6b2bc9e2c227579eb6782e65e2134 Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Fri, 23 May 2025 00:51:53 +0300 Subject: [PATCH] Android: avoid no impl found for updateNativeActivity() at startup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It seems that try/catch and ignoring the exception is not enough to silence the error message about no implementation found for the native method updateNativeActivity() when it's invoked at the start before the libraries are loaded. To fix that we can call it only if m_stateDetails.isStarted assuming that it would mean the libraries were loaded since the app has been started. Pick-to: 6.9 6.8 Change-Id: Ic23ce16439000090e2661b2e6956bcd9954bf33f Reviewed-by: Tinja Paavoseppä --- src/android/jar/src/org/qtproject/qt/android/QtNative.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/android/jar/src/org/qtproject/qt/android/QtNative.java b/src/android/jar/src/org/qtproject/qt/android/QtNative.java index b6e17ce6636..bbb6487e899 100644 --- a/src/android/jar/src/org/qtproject/qt/android/QtNative.java +++ b/src/android/jar/src/org/qtproject/qt/android/QtNative.java @@ -69,7 +69,8 @@ public class QtNative synchronized (m_mainActivityMutex) { m_activity = new WeakReference<>(qtMainActivity); try { - updateNativeActivity(); + if (m_stateDetails.isStarted) + updateNativeActivity(); } catch (UnsatisfiedLinkError ignored) { // No-op - this happens in certain e.g. QtQuick for Android cases when we set the // Activity for the first time, before Qt native libraries have been loaded. The