Android device does not recognize apk.
-
Hi, guys!
I succeeded to build .apk(s), sign them, but the Android devices do not recognise them by some error: syntactic analyzing or parsing apk not succeeded (its a human readable message from the device) when trying to install by clicking on .apk on the device.
How to understand what is going wrong?
I successfully build several .apk(s) with different compilers, jdks, Android sdks and ndks with the same result. The last is with Qt 6.5.3 clang for arm8a, openjdk 17, sdk 33, ndk 25
(min-sdk is 23, target-sdk is 33) - the recommended by the Qt 6.5 for Android guidance.
What I am missing?Best Regards!
-
@JoeCFD I tried with openjdk 11 (as is in the video from the oficial guidance), there is a problem with the cmdline-tools which always upgrade to latest (I installed 10 (not 11, the latest) and the problem was that openjdk 11 is class type 55 which conflicts with the upgraded latest wich require class type 61, which is openjdk 17... I succeeded to cheat this for some time and to create an .apk, but I did not sign it and the .apk was not recognised/ installed on the device... The question after your suggestion here is: is the mandatory to sign the .apk to be installed on the device or not? And if not, then your suggestion will not solve the problem.
-
@Stamat Also, I found some other issues (building, because I tried again your suggestion but for Android 10 (SDK 29)): build failed because: android:allowNativeHeapPointerTagging="false", to 10 version have to be true.
Also, in the Project/ Build environment
ANDROID_NDK_PLATFORM was android-23, although the used NDK is 21...@JoeCFD You can check is this value is equal with the returned from executed (again as above): apkanalyzer -h manifest target-sdk path_to_your_apk
and to chech the min-sdk:
apkanalyzer -h manifest min-sdk path_to_your_apk -
-
@Stamat An update here:
I am building (you can decode): build-btchat-Android_Qt_6_5_3_Clang_arm64_v8a-Debug (for release too, with signing also...);
I am using:
-C:\Program Files\Eclipse Adoptium\jdk-17.0.8.101-hotspot, gradle here is 8.0 (automatically set);
as I remember the chain:
-The Android gradle plugin wants Android min build tools 30.0.3 (not 29.0.3, I am tried for android-29);
-android-29;
-ndk\23.1.7779620 (I experienced some problem by trying to use 25.1.8937393, relating to begin and end.so.o and additional libraries missing).
=here a problem relating to manifest android:allowNativeHeapPointerTagging was experienced (solved by custom manifest, trying =false, =true, and finally deleted from the manifest);
=BUT the build apk is not installing on android 10 device tablet, and by using SAI (Split APKs Installer) app the error is: INSTALL_PARSE_FAILED_NOT_APK.
There are some points in Internet about this, but what is going wrong? -
@Stamat Here is another non-on-device recognition, but with build verification signing logs:
BUILD SUCCESSFUL in 9m 48s
40 actionable tasks: 40 executed
Verifies
Verified using v1 scheme (JAR signing): true
Verified using v2 scheme (APK Signature Scheme v2): true
Verified using v3 scheme (APK Signature Scheme v3): true
Verified using v4 scheme (APK Signature Scheme v4): false
Verified for SourceStamp: false
Number of signers: 1
WARNING: META-INF/com/android/build/gradle/app-metadata.properties not protected by signature. Unauthorized modifications to this JAR entry will not be detected. Delete or move the entry outside of META-INF/.
Android package built successfully in 675.637 ms.
-- File: C:/Programs/qt/Examples/Qt-6.5.3/widgets/painting/build-affine-Android_Qt_6_5_3_Clang_arm64_v8a-Release/android-build//build/outputs/apk/release/android-build-release-signed.apk
15:54:36: The process "C:\Programs\qt\6.5.3\mingw_64\bin\androiddeployqt.exe" exited normally.
15:54:37: Elapsed time: 16:36.