Closed 0xFEEDC0DE64 closed 4 months ago
UPDATE: New Qt version seems to change api. Got it compiling like this:
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
nsdManager = QAndroidJniObject("qtzeroconf/QZeroConfNsdManager", "(JLandroid/content/Context;)V", reinterpret_cast<quint64>(this), QtAndroid::androidActivity().object());
#else
nsdManager = QAndroidJniObject("qtzeroconf/QZeroConfNsdManager", "(JLandroid/content/Context;)V", reinterpret_cast<quint64>(this), QNativeInterface::QAndroidApplication::context()
#if (QT_VERSION >= QT_VERSION_CHECK(6, 7, 0))
.object<jobject>()
#endif
);
#endif
But now I'm facing a runtime exception:
I HWUI : Davey! duration=5256ms; Flags=0, FrameTimelineVsyncId=41291, IntendedVsync=2616629183534, Vsync=2616695850198, InputEventId=0, HandleInputStart=2616703447019, AnimationStart=2616703448091, PerformTraversalsStart=2616703448682, DrawStart=2621773764300, FrameDeadline=2616645850200, FrameInterval=2616703425408, FrameStartTime=16666666, SyncQueued=2621791574707, SyncStart=2621792065473, IssueDrawCommandsStart=2621799550645, SwapBuffers=2621813347950, FrameCompleted=2621885942921, DequeueBufferDuration=3256, QueueBufferDuration=7634652, GpuCompleted=2621813347950, SwapBuffersCompleted=2621885942921, DisplayPresentTime=0, CommandSubmissionCompleted=2621813347950,
W libredacted-app_x86_64.so: java.lang.ClassNotFoundException: Didn't find class "qtzeroconf.QZeroConfNsdManager" on path: DexPathList[[zip file "/data/app/~~MMSVJt4sMi1n1V0RrpS1Kw==/app.redacted.io-C-UNIUztfEDvsgpc79q7sw==/base.apk"],nativeLibraryDirectories=[/system/lib64, /system_ext/lib64]]
W libredacted-app_x86_64.so: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
W libredacted-app_x86_64.so: at java.lang.ClassLoader.loadClass(ClassLoader.java:637)
W libredacted-app_x86_64.so: at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
W libredacted-app_x86_64.so: at org.qtproject.qt.android.QtNative.startQtApplication(Native Method)
W libredacted-app_x86_64.so: at org.qtproject.qt.android.QtNative$$ExternalSyntheticLambda4.run(D8$$SyntheticClass:0)
W libredacted-app_x86_64.so: at org.qtproject.qt.android.QtThread$1.run(QtThread.java:25)
W libredacted-app_x86_64.so: at java.lang.Thread.run(Thread.java:1012)
06-27 22:03:28.298 10211 10302 W libredacted-app_x86_64.so:
F app.redacted.io: java_vm_ext.cc:599] JNI DETECTED ERROR IN APPLICATION: GetMethodID received NULL jclass
F app.redacted.io: java_vm_ext.cc:599] in call to GetMethodID
F app.redacted.io: java_vm_ext.cc:599] from void org.qtproject.qt.android.QtNative.runPendingCppRunnables()
D EGL_emulation: app_time_stats: avg=545.28ms min=47.23ms max=1515.80ms count=3
F app.redacted.io: runtime.cc:709] Runtime aborting...
F app.redacted.io: runtime.cc:709] Dumping all threads without mutator lock held
F app.redacted.io: runtime.cc:709] All threads:
F app.redacted.io: runtime.cc:709] DALVIK THREADS (34):
F app.redacted.io: runtime.cc:709] "main" prio=10 tid=1 Runnable
F app.redacted.io: runtime.cc:709] | group="" sCount=0 ucsCount=0 flags=0 obj=0x73baab68 self=0x71ec89527be0
F app.redacted.io: runtime.cc:709] | sysTid=10211 nice=-10 cgrp=top-app sched=0/0 handle=0x71ef08760d18
F app.redacted.io: runtime.cc:709] | state=R schedstat=( 364004470 229983975 5868 ) utm=28 stm=7 core=1 HZ=100
F app.redacted.io: runtime.cc:709] | stack=0x7fff8d2c1000-0x7fff8d2c3000 stackSize=8188KB
F app.redacted.io: runtime.cc:709] | held mutexes= "abort lock" "mutator lock"(shared held)
F app.redacted.io: runtime.cc:709] native: #00 pc 007af053 /apex/com.android.art/lib64/libart.so (art::DumpNativeStack+211) (BuildId: b8c05a18334839084b4c590bfef2c431)
F app.redacted.io: runtime.cc:709] native: #01 pc 0089cfb6 /apex/com.android.art/lib64/libart.so (art::Thread::DumpStack const+358) (BuildId: b8c05a18334839084b4c590bfef2c431)
F app.redacted.io: runtime.cc:709] native: #02 pc 008bd176 /apex/com.android.art/lib64/libart.so (art::DumpCheckpoint::Run+1094) (BuildId: b8c05a18334839084b4c590bfef2c431)
F app.redacted.io: runtime.cc:709] native: #03 pc 008b67b7 /apex/com.android.art/lib64/libart.so (art::ThreadList::RunCheckpoint+439) (BuildId: b8c05a18334839084b4c590bfef2c431)
F app.redacted.io: runtime.cc:709] native: #04 pc 008b5978 /apex/com.android.art/lib64/libart.so (art::ThreadList::Dump+1608) (BuildId: b8c05a18334839084b4c590bfef2c431)
F app.redacted.io: runtime.cc:709] native: #05 pc 00868abc /apex/com.android.art/lib64/libart.so (art::AbortState::Dump const+188) (BuildId: b8c05a18334839084b4c590bfef2c431)
F app.redacted.io: runtime.cc:709] native: #06 pc 0084fb1d /apex/com.android.art/lib64/libart.so (art::Runtime::Abort+1613) (BuildId: b8c05a18334839084b4c590bfef2c431)
F app.redacted.io: runtime.cc:709] native: #07 pc 00019bda /apex/com.android.art/lib64/libbase.so (android::base::SetAborter::$_0::__invoke+58) (BuildId: 09cb5f70217010d6e9c42da91b321c20)
F app.redacted.io: runtime.cc:709] native: #08 pc 00019040 /apex/com.android.art/lib64/libbase.so (android::base::LogMessage::~LogMessage+400) (BuildId: 09cb5f70217010d6e9c42da91b321c20)
F app.redacted.io: runtime.cc:709] native: #09 pc 00654ae4 /apex/com.android.art/lib64/libart.so (art::JavaVMExt::JniAbort+2404) (BuildId: b8c05a18334839084b4c590bfef2c431)
F app.redacted.io: runtime.cc:709] native: #10 pc 00654b45 /apex/com.android.art/lib64/libart.so (art::JavaVMExt::JniAbortV+85) (BuildId: b8c05a18334839084b4c590bfef2c431)
F app.redacted.io: runtime.cc:709] native: #11 pc 006473af /apex/com.android.art/lib64/libart.so (art::::ScopedCheck::AbortF +191) (BuildId: b8c05a18334839084b4c590bfef2c431)
F app.redacted.io: runtime.cc:709] native: #12 pc 0064648b /apex/com.android.art/lib64/libart.so (art::::ScopedCheck::CheckInstance +203) (BuildId: b8c05a18334839084b4c590bfef2c431)
F app.redacted.io: runtime.cc:709] native: #13 pc 00644986 /apex/com.android.art/lib64/libart.so (art::::ScopedCheck::Check +870) (BuildId: b8c05a18334839084b4c590bfef2c431)
F app.redacted.io: runtime.cc:709] native: #14 pc 0064894d /apex/com.android.art/lib64/libart.so (art::::CheckJNI::GetMethodIDInternal +621) (BuildId: b8c05a18334839084b4c590bfef2c431)
F app.redacted.io: runtime.cc:709] native: #15 pc 005355f4 /data/app/~~MMSVJt4sMi1n1V0RrpS1Kw==/app.redacted.io-C-UNIUztfEDvsgpc79q7sw==/lib/x86_64/libQt6Core_x86_64.so (QJniObject::getMethodID+38) (BuildId: 4882df7922cd6b4fdcc5d8cd37ee4f4c1a18c9f4)
Can you tell me what version of Qt, NDK and SDK you are seeing this happen on? Qt6.7 is not compiling on Debian 12 (unless they fixed it in 6.7.2), so I don't have a way to test Qt6.7 issues.
I got a Qt6.7.2 built. https://forum.qt.io/topic/152669/unable-to-compile-qt-because-of-missing-litehtml I will try reproducing the issue tonight. Can you tell me what version of Qt, NDK and SDK you are seeing this happen on?
Qt 6.8.0 from the official installer on the website SDK and NDK are downloaded by qtcreator Android build tools version 34 selected in the project
I could fix all issues by adding the .java file into android/src/, will create a merge request now
Turns out QNativeInterface does not provide source compatibility. https://bugreports.qt.io/browse/QTBUG-123900. I have pushed to master.
I have already tried ignoring this compiler warning but it just results in a crash at runtime (exactly as the compiler said)
What can we do to get this running again?