Android app doesn't run
-
The error message indicates that you are trying to run a Java class file compiled with a higher version of the Java compiler than the version of the Java Runtime Environment (JRE) you have installed.
In this case:
Class file version 61.0 corresponds to Java 17. Class file version 55.0 corresponds to Java 11.
==============================================================
Your installation is messed up. -
@JoeCFD said in Android app doesn't run:
Your installation is messed up.
Well, that's an understatement. From a terminal, I get this:
C:\Users\michael.zimmers>java -version openjdk version "21.0.1" 2023-10-17 LTS OpenJDK Runtime Environment Temurin-21.0.1+12 (build 21.0.1+12-LTS) OpenJDK 64-Bit Server VM Temurin-21.0.1+12 (build 21.0.1+12-LTS, mixed mode, sharing)
Is this not the same JRE instance that Creator is trying to use?
-
-
-
@mzimmers perhaps you run into this: https://forum.qt.io/post/785169
-
@mzimmers you can try a QtCreator 12.0.2 snapshot: https://download.qt.io/snapshots/qtcreator/12.0/12.0.2/28/
let us know if this works better -
@ekkescorner said in Android app doesn't run:
@mzimmers perhaps you run into this: https://forum.qt.io/post/785169
This definitely helps. Combined with regenerating the android files, and deleting the build directory, I'm past that error. (I'm onto another error, but I think this is my doing. I'm posting the relevant output here.)
E project.exampl: Not starting debugger since process cannot load the jdwp agent. W System : ClassLoader referenced unknown path: I DecorView: [INFO] isPopOver=false, config=true I DecorView: updateCaptionType >> DecorView@c5c2492[], isFloating=false, isApplication=true, hasWindowDecorCaption=false, hasWindowControllerCallback=true W linker : Warning: "/data/app/~~J43OE5MfUdxnaBtJpASGww==/org.qtproject.example-lakyk1zLaHW5FUEWp05dDQ==/lib/arm64/libc++_shared.so" unused DT entry: unknown processor-specific (type 0x70000001 arg 0x0) (ignoring) W Gralloc3: mapper 3.x is not supported E linker : library "/system/lib/libcrypto.so" ("/system/lib/libcrypto.so") needed or dlopened by "/data/app/~~J43OE5MfUdxnaBtJpASGww==/org.qtproject.example-lakyk1zLaHW5FUEWp05dDQ==/lib/arm64/libQt6Core_arm64-v8a.so" is not accessible for the namespace: [name="classloader-namespace", ld_library_paths="", default_library_paths="/data/app/~~J43OE5MfUdxnaBtJpASGww==/org.qtproject.example-lakyk1zLaHW5FUEWp05dDQ==/lib/arm64:/data/app/~~J43OE5MfUdxnaBtJpASGww==/org.qtproject.example-lakyk1zLaHW5FUEWp05dDQ==/base.apk!/lib/arm64-v8a", permitted_paths="/data:/mnt/expand:/data/data/org.qtproject.example"] W qt.tlsbackend.ossl: : Failed to load libssl/libcrypto. W qt.network.ssl: : The backend "cert-only" does not support QSslKey W qt.network.ssl: : Active TLS backend does not support key creation W libappNgaIcdFw_arm64-v8a.so: QQmlApplicationEngine failed to load component W libappNgaIcdFw_arm64-v8a.so: <Unknown File>: No module named "ngaIcdFw" found W libappNgaIcdFw_arm64-v8a.so: exit app 0 05:42:56: "org.qtproject.example" died.
I think this has to do with a recent restructuring of my project files and folders.
So:
- delete the build directory
- clear your Qt Creator cache
- use Creator to generate but NOT modify AndroidManifest.xml
appears to be a successful procedure, if my above assumption about my project restructuring is true. I'll do some more experimentation and report back.
Oh, I tried 12.0.2...no improvement. Thanks for the link, though.
-
@mzimmers said in Android app doesn't run:
use Creator to generate but NOT modify AndroidManifest.xml
if you mean by 'generate' to create templates then you must do your customization in AndrouidManifest: change application name, activity name and other properties of AndroidManifest. depends from your use-case
-
@mzimmers take a look at https://github.com/KDAB/android_openssl to get openssl
-
@ekkescorner @JoeCFD thanks for the suggestions.
After fixing the problem in my project structure, I am now able to load the program through Creator, sometimes. Sometimes I get the original error. I am also able to load the .apk from the command line (outside of Creator), so I'm reasonably confident the problem isn't in how my .apk is built.
I'm trying to ascertain why I'm still having only intermittent success with Creator. When I can determine a reliable procedure, I'll post it here.
-
Hi all - I need to return my attention to this -- I've got to get this working.
All my build setup items seem in place, and the project builds for Android just fine. But when I try to deploy and run, I get this same old error message:
Activity Manager threw the error: Error type 3 Error: Activity class {org.qtproject.example/org.qtproject.qt.android.bindings.QtActivity} does not exist.
Can anyone give me an idea what's going wrong here? Thanks...
-
what's your actual environment ?
Qt version, QtCreator Version
JDK, NDK, Java API
QMake or CMake -
- Qt 6.5.3
- Qt Creator 14.0.1
- SDK Version: 12.0
- NDK Version: 25.1.8937393
- JDK 17
- Using CMake
- Windows 11
Not sure what you mean by Java API, but maybe this will help:
C:\Users\michael.zimmers>java --version java 17.0.9 2023-10-17 LTS Java(TM) SE Runtime Environment (build 17.0.9+11-LTS-201) Java HotSpot(TM) 64-Bit Server VM (build 17.0.9+11-LTS-201, mixed mode, sharing) C:\Users\michael.zimmers>
Thanks for any assistance.