Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Android device does not recognize apk.
Forum Updated to NodeBB v4.3 + New Features

Android device does not recognize apk.

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
16 Posts 2 Posters 2.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Stamat
    wrote on last edited by Stamat
    #1

    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!

    S 1 Reply Last reply
    0
    • S Stamat

      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!

      S Offline
      S Offline
      Stamat
      wrote on last edited by
      #2

      @Stamat arm64_v8a I mean

      JoeCFDJ 1 Reply Last reply
      0
      • S Stamat

        @Stamat arm64_v8a I mean

        JoeCFDJ Offline
        JoeCFDJ Offline
        JoeCFD
        wrote on last edited by JoeCFD
        #3

        @Stamat
        Check here out. Try Java 11. I guess you build apk for Android 13
        https://forum.qt.io/topic/150354/cannot-select-api-33-for-android-target-sdk-in-qt-creator/9?_=1696342592552

        I still use NDK 21.

        S 1 Reply Last reply
        0
        • JoeCFDJ JoeCFD

          @Stamat
          Check here out. Try Java 11. I guess you build apk for Android 13
          https://forum.qt.io/topic/150354/cannot-select-api-33-for-android-target-sdk-in-qt-creator/9?_=1696342592552

          I still use NDK 21.

          S Offline
          S Offline
          Stamat
          wrote on last edited by
          #4

          @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.

          S 1 Reply Last reply
          0
          • S Stamat

            @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.

            S Offline
            S Offline
            Stamat
            wrote on last edited by
            #5

            @Stamat Ah! :) And Actually, I want to test the apk on Android 10 and 11.

            S 1 Reply Last reply
            0
            • S Stamat

              @Stamat Ah! :) And Actually, I want to test the apk on Android 10 and 11.

              S Offline
              S Offline
              Stamat
              wrote on last edited by
              #6

              @Stamat Ah! Also, on the official video the guy uses jdk11, but ndk23... But no info what are the sdk and min and target SDKs.

              JoeCFDJ 1 Reply Last reply
              0
              • S Stamat

                @Stamat Ah! Also, on the official video the guy uses jdk11, but ndk23... But no info what are the sdk and min and target SDKs.

                JoeCFDJ Offline
                JoeCFDJ Offline
                JoeCFD
                wrote on last edited by
                #7

                @Stamat In my build I simply added SDK 33 and 32 for android 12 and 13. I did not set min SDK. My app works ok in Android 12 and 13.

                S 1 Reply Last reply
                0
                • JoeCFDJ JoeCFD

                  @Stamat In my build I simply added SDK 33 and 32 for android 12 and 13. I did not set min SDK. My app works ok in Android 12 and 13.

                  S Offline
                  S Offline
                  Stamat
                  wrote on last edited by
                  #8

                  @JoeCFD But, could you please enter in your cmdline-tools\latest\bin and execute sdkmanager --list > JoeCFD.txt and send to me?

                  S 1 Reply Last reply
                  0
                  • S Stamat

                    @JoeCFD But, could you please enter in your cmdline-tools\latest\bin and execute sdkmanager --list > JoeCFD.txt and send to me?

                    S Offline
                    S Offline
                    Stamat
                    wrote on last edited by Stamat
                    #9

                    @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

                    S 1 Reply Last reply
                    0
                    • S Stamat referenced this topic on
                    • S Stamat

                      @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

                      S Offline
                      S Offline
                      Stamat
                      wrote on last edited by
                      #10

                      @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?

                      S 1 Reply Last reply
                      0
                      • S Stamat

                        @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?

                        S Offline
                        S Offline
                        Stamat
                        wrote on last edited by
                        #11

                        @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.

                        S 1 Reply Last reply
                        0
                        • S Stamat

                          @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.

                          S Offline
                          S Offline
                          Stamat
                          wrote on last edited by Stamat
                          #12

                          @Stamat
                          Is there some suggestion/ advice here? What is the working build tools configuration? I want to have recognizable .apk for Android 10 and Android 11 at this stage.

                          S 1 Reply Last reply
                          0
                          • S Stamat

                            @Stamat
                            Is there some suggestion/ advice here? What is the working build tools configuration? I want to have recognizable .apk for Android 10 and Android 11 at this stage.

                            S Offline
                            S Offline
                            Stamat
                            wrote on last edited by
                            #13

                            @Stamat I am using qmake, is this a problem?

                            S 1 Reply Last reply
                            0
                            • S Stamat

                              @Stamat I am using qmake, is this a problem?

                              S Offline
                              S Offline
                              Stamat
                              wrote on last edited by
                              #14

                              Guys are you lucky beginners and do not know why your .apk(s) work(s)!!!

                              S 1 Reply Last reply
                              0
                              • S Stamat

                                Guys are you lucky beginners and do not know why your .apk(s) work(s)!!!

                                S Offline
                                S Offline
                                Stamat
                                wrote on last edited by
                                #15

                                @Stamat https://developer.android.com/build/releases/past-releases/agp-7-0-0-release-notes

                                S 1 Reply Last reply
                                0
                                • S Stamat

                                  @Stamat https://developer.android.com/build/releases/past-releases/agp-7-0-0-release-notes

                                  S Offline
                                  S Offline
                                  Stamat
                                  wrote on last edited by
                                  #16

                                  @Stamat https://developer.android.com/build/releases/gradle-plugin

                                  1 Reply Last reply
                                  0

                                  • Login

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • Users
                                  • Groups
                                  • Search
                                  • Get Qt Extensions
                                  • Unsolved