Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Init new Android project



  • Hello!
    I'm trying to initialize a new cross platform project, in particular I'm working on the android "side".
    I have installed what is needed to create a new android device but...
    when I press "Create Template" I need the content of two folders: "<android_sdk_home>/tools/templates" and "/usr/src/android/templates" (that aren't the same folder, I think).
    How did you solved this problem?

    For the first folder I have donwloaded android-studio and copied a folder called template in tools... but it I have used only some imagination, so this isn't a solution.


  • Moderators

    You need:

    • install Android SDK (can be done by installing Android Studio)
    • install Android NDK (can be done from within Android Studio's SDK manager)
    • install Qt for Android
    • in Qt Creator, go to preferences->Devices->Android and specify the paths where your SDK and NDK are located

    After these 4 steps you should be ready to go. There is no need to manually copy any templates or anything.



  • I have deleted the previous android SDK, installed android studio (latest version downloaded yesterday) and I have installed:

      build-tools;29.0.3   | 29.0.3       | Android SDK Build-Tools 29.0.3          | build-tools/29.0.3/  
      cmdline-tools;latest | 1.0          | Android SDK Command-line Tools (latest) | cmdline-tools/latest/
      emulator             | 30.0.5       | Android Emulator                        | emulator/            
      ndk;21.0.6113669     | 21.0.6113669 | NDK (Side by side) 21.0.6113669         | ndk/21.0.6113669/    
      patcher;v4           | 1            | SDK Patch Applier v4                    | patcher/v4/          
      platform-tools       | 29.0.6       | Android SDK Platform-Tools              | platform-tools/      
      platforms;android-29 | 4            | Android SDK Platform 29                 | platforms/android-29/
      sources;android-29   | 1            | Sources for Android 29                  | sources/android-29/
    

    the problem is the same as installing only the sdkmanager.


  • Moderators

    And what is that problem? Do you get any error message? Does the application not build? Does Qt Creator complain?


  • Banned

    Even I am looking for a solution. Somebody please help me with that.



  • when qtcreator tries to create the gradle and android template, it fails because there is no template in the android SDK


  • Moderators

    @dxvx said in Init new Android project:

    when qtcreator tries to create the gradle and android template, it fails because there is no template in the android SDK

    Possibly Google changed the layout again. Sorry, I don't know how to fix this, last time I tried creating templates it worked fine. Make sure you're using the newest Qt Creator and if it persists, please report a bug on Qt bug tracker.


Log in to reply