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. Can't build Anroid app with 5.9.1
Qt 6.11 is out! See what's new in the release blog

Can't build Anroid app with 5.9.1

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
11 Posts 3 Posters 5.3k Views 2 Watching
  • 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.
  • A Offline
    A Offline
    ajee
    wrote on last edited by ajee
    #1

    Hi,

    I am new to Qt, so if there is something I mess up please forgive me.

    What I have is Qt creator 4.3.1, Qt 5.9.1, have toolkit setup as the figure:

    0_1506931373021_67b593cd-7ac6-4e70-b9d4-b0bb4ce2965e-image.png

    My first question is , why the "Android build SDK" has a null droplist.
    You can see as the following:

    0_1506930783663_08a702bf-86db-479a-a6f6-66e067cd2372-image.png

    I ask this, because during building, there is a "warning: Android platform 'android--1' does not exist in SDK", somebody said to work through it by selecting this "Android build SDK".

    My second question is : build a simple app, it failed at the last steps. (From the above figure you can see I also tried to create a selfsigned certificate for it but no luck)

    Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
    at sun.security.ssl.Alerts.getSSLException(java.base@9-internal/Alerts.java:198)
    at sun.security.ssl.SSLSocketImpl.fatal(java.base@9-internal/SSLSocketImpl.java:1949)
    at sun.security.ssl.Handshaker.fatalSE(java.base@9-internal/Handshaker.java:309)
    at sun.security.ssl.Handshaker.fatalSE(java.base@9-internal/Handshaker.java:303)
    at sun.security.ssl.ClientHandshaker.checkServerCerts(java.base@9-internal/ClientHandshaker.java:1841)
    ...........

    I have searched by Google bu could not find any useful workaround.

    Thanks for your help!

    raven-worxR 1 Reply Last reply
    0
    • A ajee

      Hi,

      I am new to Qt, so if there is something I mess up please forgive me.

      What I have is Qt creator 4.3.1, Qt 5.9.1, have toolkit setup as the figure:

      0_1506931373021_67b593cd-7ac6-4e70-b9d4-b0bb4ce2965e-image.png

      My first question is , why the "Android build SDK" has a null droplist.
      You can see as the following:

      0_1506930783663_08a702bf-86db-479a-a6f6-66e067cd2372-image.png

      I ask this, because during building, there is a "warning: Android platform 'android--1' does not exist in SDK", somebody said to work through it by selecting this "Android build SDK".

      My second question is : build a simple app, it failed at the last steps. (From the above figure you can see I also tried to create a selfsigned certificate for it but no luck)

      Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
      at sun.security.ssl.Alerts.getSSLException(java.base@9-internal/Alerts.java:198)
      at sun.security.ssl.SSLSocketImpl.fatal(java.base@9-internal/SSLSocketImpl.java:1949)
      at sun.security.ssl.Handshaker.fatalSE(java.base@9-internal/Handshaker.java:309)
      at sun.security.ssl.Handshaker.fatalSE(java.base@9-internal/Handshaker.java:303)
      at sun.security.ssl.ClientHandshaker.checkServerCerts(java.base@9-internal/ClientHandshaker.java:1841)
      ...........

      I have searched by Google bu could not find any useful workaround.

      Thanks for your help!

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @ajee said in Can't build Anroid app with 5.9.1:

      My first question is , why the "Android build SDK" has a null droplist

      this is a known issue (QTCREATORBUG-18962, and some others) and will be fixed with QtCreator 4.5 (so this might take a while until the next release)

      A workaround is to downgrade the SDK tools to manually 25.x.x (see this)

      My second question is : build a simple app, it failed at the last steps. (From the above figure you can see I also tried to create a selfsigned certificate for it but no luck)

      The issue from question 1 is essential. So i guess this is just a follow up issue. Since you end up using a wrong android SDK after all.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      A raven-worxR 2 Replies Last reply
      1
      • raven-worxR raven-worx

        @ajee said in Can't build Anroid app with 5.9.1:

        My first question is , why the "Android build SDK" has a null droplist

        this is a known issue (QTCREATORBUG-18962, and some others) and will be fixed with QtCreator 4.5 (so this might take a while until the next release)

        A workaround is to downgrade the SDK tools to manually 25.x.x (see this)

        My second question is : build a simple app, it failed at the last steps. (From the above figure you can see I also tried to create a selfsigned certificate for it but no luck)

        The issue from question 1 is essential. So i guess this is just a follow up issue. Since you end up using a wrong android SDK after all.

        A Offline
        A Offline
        ajee
        wrote on last edited by ajee
        #3

        @raven-worx Following the reply above, I have tried as modifying to
        <value type="QString" key="BuildTargetSdk">android-26</value>
        It can workaround the warning "warning: Android platform 'android--1' does not exist in SDK".

        But the second one, still exists no matter I try android-26, android-25 and android-24, So I don't think it is related to the first question? Just another snapshot to show I have older SDK installed and play with them as said. Do you need any further log from me to troubleshooting? Just wonder only me seeing this ?

        0_1506942202303_825fd132-69cf-4c1f-86a0-4492a2068b83-image.png

        raven-worxR 1 Reply Last reply
        0
        • A ajee

          @raven-worx Following the reply above, I have tried as modifying to
          <value type="QString" key="BuildTargetSdk">android-26</value>
          It can workaround the warning "warning: Android platform 'android--1' does not exist in SDK".

          But the second one, still exists no matter I try android-26, android-25 and android-24, So I don't think it is related to the first question? Just another snapshot to show I have older SDK installed and play with them as said. Do you need any further log from me to troubleshooting? Just wonder only me seeing this ?

          0_1506942202303_825fd132-69cf-4c1f-86a0-4492a2068b83-image.png

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          @ajee said in Can't build Anroid app with 5.9.1:

          Following the reply above, I have tried as modifying to
          <value type="QString" key="BuildTargetSdk">android-26</value>
          It can workaround the warning "warning: Android platform 'android--1' does not exist in SDK".

          but you should download the tools from the links and replace the tools folder in your SDK folder.
          I am not 100% sure if something else still breaks in the back.

          That definitely works, since i've tried it myself already.

          What are you doing in your simple app causing the exception?

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          A 1 Reply Last reply
          0
          • raven-worxR raven-worx

            @ajee said in Can't build Anroid app with 5.9.1:

            Following the reply above, I have tried as modifying to
            <value type="QString" key="BuildTargetSdk">android-26</value>
            It can workaround the warning "warning: Android platform 'android--1' does not exist in SDK".

            but you should download the tools from the links and replace the tools folder in your SDK folder.
            I am not 100% sure if something else still breaks in the back.

            That definitely works, since i've tried it myself already.

            What are you doing in your simple app causing the exception?

            A Offline
            A Offline
            ajee
            wrote on last edited by
            #5

            Hi,

            I rename the tools under Android/Sdk to tools_org and then download http://dl-ssl.google.com/android/repository/tools_r25.2.5-linux.zip , unzip and put in under Android/Sdk. Now the Qt creator can show up the droplist for android 24-26 ( which I have downloaded by Android studio).

            But still, the build failed with "Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found", no matter I choose "Sign Package" with my selfsigned cert or not.

            I did nothing special, just download a Qt community installer then install it on my Ubuntu 16.04. Frustrated, is there any docker for Qt latest development environment so that we don't need meet such problems?

            Thanks

            raven-worxR 1 Reply Last reply
            0
            • A ajee

              Hi,

              I rename the tools under Android/Sdk to tools_org and then download http://dl-ssl.google.com/android/repository/tools_r25.2.5-linux.zip , unzip and put in under Android/Sdk. Now the Qt creator can show up the droplist for android 24-26 ( which I have downloaded by Android studio).

              But still, the build failed with "Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found", no matter I choose "Sign Package" with my selfsigned cert or not.

              I did nothing special, just download a Qt community installer then install it on my Ubuntu 16.04. Frustrated, is there any docker for Qt latest development environment so that we don't need meet such problems?

              Thanks

              raven-worxR Offline
              raven-worxR Offline
              raven-worx
              Moderators
              wrote on last edited by
              #6

              @ajee said in Can't build Anroid app with 5.9.1:

              But still, the build failed with "Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found", no matter I choose "Sign Package" with my selfsigned cert or not.

              what is your app doing exactly? This rather looks like you are attempting to connect to a SSL (HTTPS?) address somewhere inside your Java code.
              This has nothing todo with signing your app package.

              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
              If you have a question please use the forum so others can benefit from the solution in the future

              A 1 Reply Last reply
              0
              • raven-worxR raven-worx

                @ajee said in Can't build Anroid app with 5.9.1:

                But still, the build failed with "Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found", no matter I choose "Sign Package" with my selfsigned cert or not.

                what is your app doing exactly? This rather looks like you are attempting to connect to a SSL (HTTPS?) address somewhere inside your Java code.
                This has nothing todo with signing your app package.

                A Offline
                A Offline
                ajee
                wrote on last edited by
                #7

                @raven-worx Thank you for your reply, I just built one of the examples from Qt itself, named heartrate-game, I don't see any java code for it.

                0_1507018031410_95614044-4931-4319-84b1-2fab8535c512-image.png

                S 1 Reply Last reply
                0
                • raven-worxR raven-worx

                  @ajee said in Can't build Anroid app with 5.9.1:

                  My first question is , why the "Android build SDK" has a null droplist

                  this is a known issue (QTCREATORBUG-18962, and some others) and will be fixed with QtCreator 4.5 (so this might take a while until the next release)

                  A workaround is to downgrade the SDK tools to manually 25.x.x (see this)

                  My second question is : build a simple app, it failed at the last steps. (From the above figure you can see I also tried to create a selfsigned certificate for it but no luck)

                  The issue from question 1 is essential. So i guess this is just a follow up issue. Since you end up using a wrong android SDK after all.

                  raven-worxR Offline
                  raven-worxR Offline
                  raven-worx
                  Moderators
                  wrote on last edited by
                  #8

                  @raven-worx said in Can't build Anroid app with 5.9.1:

                  this is a known issue (QTCREATORBUG-18962, and some others) and will be fixed with QtCreator 4.5 (so this might take a while until the next release)
                  A workaround is to downgrade the SDK tools to manually 25.x.x (see this)

                  seems like this is now already fixed with QtCreator 4.4.1/Qt5.9.2

                  --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                  If you have a question please use the forum so others can benefit from the solution in the future

                  1 Reply Last reply
                  1
                  • A ajee

                    @raven-worx Thank you for your reply, I just built one of the examples from Qt itself, named heartrate-game, I don't see any java code for it.

                    0_1507018031410_95614044-4931-4319-84b1-2fab8535c512-image.png

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

                    @ajee said in Can't build Anroid app with 5.9.1:

                    @raven-worx Thank you for your reply, I just built one of the examples from Qt itself, named heartrate-game, I don't see any java code for it.

                    0_1507018031410_95614044-4931-4319-84b1-2fab8535c512-image.png

                    I have the same erorrs (No trusted certificate found) while building heartrate-game from examples or a new QtQuick Controls 2 Application.

                    Qt Creator 4.4.1
                    Based on Qt 5.9.2 (GCC 5.3.1 20160406 (Red Hat 5.3.1-6), 64 bit)
                    Built on Oct 4 2017 04:14:10
                    From revision 6afdb8bdf9
                    

                    Using the latest Android Sdk with android-26. FWIW I see similar error messages when I attempt to run sdkmanager --list manually, both from Sdk/tools and the older 25.2.5 tools-

                    shantanu@shaan-desktop:~/software/Android/Sdk/tools$ ./bin/sdkmanager --list
                    Warning: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
                    Warning: File /home/shantanu/.android/repositories.cfg could not be loaded.     
                    Warning: Failed to download any source lists!                                   
                    Installed packages:=====================] 100% Computing updates...             
                      Path                        | Version | Description                    | Location                    
                      -------                     | ------- | -------                        | -------                     
                      build-tools;26.0.2          | 26.0.2  | Android SDK Build-Tools 26.0.2 | build-tools/26.0.2/         
                      emulator                    | 26.1.4  | Android Emulator               | emulator/                   
                      extras;android;m2repository | 47.0.0  | Android Support Repository     | extras/android/m2repository/
                      extras;google;m2repository  | 58      | Google Repository              | extras/google/m2repository/ 
                      patcher;v4                  | 1       | SDK Patch Applier v4           | patcher/v4/                 
                      platform-tools              | 26.0.1  | Android SDK Platform-Tools     | platform-tools/             
                      platforms;android-26        | 2       | Android SDK Platform 26        | platforms/android-26/       
                      sources;android-26          | 1       | Sources for Android 26         | sources/android-26/         
                      tools                       | 26.1.1  | Android SDK Tools              | tools/
                    
                    shantanu@shaan-desktop:~/software/android/tools$ ./bin/sdkmanager --list
                    Warning: File /home/shantanu/.android/repositories.cfg could not be loaded.
                    Warning: Failed to download any source lists!
                    Warning: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
                    Installed packages:
                      Path  | Version | Description              | Location
                      ------- | ------- | -------                  | ------- 
                      tools | 25.2.5  | Android SDK Tools 25.2.5 | tools/ 
                    

                    But when I run Android Studio, its able to install packages fine :/

                    S 1 Reply Last reply
                    0
                    • S shaan7

                      @ajee said in Can't build Anroid app with 5.9.1:

                      @raven-worx Thank you for your reply, I just built one of the examples from Qt itself, named heartrate-game, I don't see any java code for it.

                      0_1507018031410_95614044-4931-4319-84b1-2fab8535c512-image.png

                      I have the same erorrs (No trusted certificate found) while building heartrate-game from examples or a new QtQuick Controls 2 Application.

                      Qt Creator 4.4.1
                      Based on Qt 5.9.2 (GCC 5.3.1 20160406 (Red Hat 5.3.1-6), 64 bit)
                      Built on Oct 4 2017 04:14:10
                      From revision 6afdb8bdf9
                      

                      Using the latest Android Sdk with android-26. FWIW I see similar error messages when I attempt to run sdkmanager --list manually, both from Sdk/tools and the older 25.2.5 tools-

                      shantanu@shaan-desktop:~/software/Android/Sdk/tools$ ./bin/sdkmanager --list
                      Warning: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
                      Warning: File /home/shantanu/.android/repositories.cfg could not be loaded.     
                      Warning: Failed to download any source lists!                                   
                      Installed packages:=====================] 100% Computing updates...             
                        Path                        | Version | Description                    | Location                    
                        -------                     | ------- | -------                        | -------                     
                        build-tools;26.0.2          | 26.0.2  | Android SDK Build-Tools 26.0.2 | build-tools/26.0.2/         
                        emulator                    | 26.1.4  | Android Emulator               | emulator/                   
                        extras;android;m2repository | 47.0.0  | Android Support Repository     | extras/android/m2repository/
                        extras;google;m2repository  | 58      | Google Repository              | extras/google/m2repository/ 
                        patcher;v4                  | 1       | SDK Patch Applier v4           | patcher/v4/                 
                        platform-tools              | 26.0.1  | Android SDK Platform-Tools     | platform-tools/             
                        platforms;android-26        | 2       | Android SDK Platform 26        | platforms/android-26/       
                        sources;android-26          | 1       | Sources for Android 26         | sources/android-26/         
                        tools                       | 26.1.1  | Android SDK Tools              | tools/
                      
                      shantanu@shaan-desktop:~/software/android/tools$ ./bin/sdkmanager --list
                      Warning: File /home/shantanu/.android/repositories.cfg could not be loaded.
                      Warning: Failed to download any source lists!
                      Warning: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
                      Installed packages:
                        Path  | Version | Description              | Location
                        ------- | ------- | -------                  | ------- 
                        tools | 25.2.5  | Android SDK Tools 25.2.5 | tools/ 
                      

                      But when I run Android Studio, its able to install packages fine :/

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

                      Found it, was a PEBKAC. My Ubuntu only had openjdk-8-jre installed, I had to also install openjdk-8-jdk

                      A 1 Reply Last reply
                      0
                      • S shaan7

                        Found it, was a PEBKAC. My Ubuntu only had openjdk-8-jre installed, I had to also install openjdk-8-jdk

                        A Offline
                        A Offline
                        ajee
                        wrote on last edited by ajee
                        #11

                        @shaan7 Hi, I notice that my difference from you is that the JDK localtion in Projects-> Manage Kits... -> Devices -> Android is pointing to /usr/lib/jvm/java-9-openjdk-amd64. So as you said, I switch it to java-8-openjdk-amd64. I also check the corresponding jre installed. But still no luck, while the error msg changed to

                        Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

                        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