QT下搭建Android开发环境

家电修理 2023-07-16 19:17www.caominkang.com电器维修

1.目录新建

根目录:  /Android

  子目录:   jdk-1.8 JAVA SDK

                  ndk-20 Android NDK

                  android-sdkcmdline-toolslatest : Android SDK home

2.安装JDK1.8

(最好这个网址下)

    下载地址https://github./ojdkbuild/ojdkbuild

https://github./ojdkbuild/ojdkbuild/releases/donload/java-1.8.0-openjdk-1.8.0.312-1.b07/java-1.8.0-openjdk-1.8.0.312-1.b07.ojdkbuild.indos.x86_64.zip         

    解压至jdk-1.8

   

3.下载Android NDK

    下载地址https://dl.google./android/repository/android-ndk-r20b-indos-x86_64.zip

    解压至ndk-20

4.下载Android Studio CMD

    下载地址https://dl.google./android/repository/mandliools-in-7583922_latest.zip

      解压至android-sdkcmdline-toolslatest

   

5.设置环境变量

    JAVA_HOME=/Android/jdk-1.8

    ANDROID_SDK_ROOT=/Android/android-sdk

    ANDROID_SDK_HOME=/Android/android-sdk

6.安装SDK

  cd Androidandroid-sdkcmdline-toolslatest

  sdkmanager  "platforms;android-28" "platform-tools" "build-tools;28.0.3" "system-images;android-28;default;x86_64" "extras;intel;Hardare_Aelerated_Execution_Manager" "emulator"

  //"system-images;android-28;default;x86_64"根据AVD类型选择

  //备注以下目前系统安装的额外包,如果出现问题,可以补充安装以下包

  add-ons;addon-google_apis-google-24                                              

  build-tools;28.0.3                                                                                                                               

  emulator                                                                         

  extras;android;m2repository                                                       

  extras;google;auto                                                               

  extras;google;m2repository                                                       

  extras;google;market_licensing                                                    

  extras;intel;Hardare_Aelerated_Execution_Manager                              

  extras;m2repository;;android;support;constraint;constraint-layout-solver;1.0.2

  patcher;v4                                                                        

  platform-tools                                                                   

  platforms;android-28                                                             

  system-images;android-28;default;x86_64                         

7.设置PC VT 和安装HMAX

  进入BOIS,设置VT  enabled

  进入android-sdkextrasintelHardare_Aelerated_Execution_Manager,运行haxm-7.6.5-setup.exe

 

8.创建AVD

  cd Androidandroid-sdkcmdline-toolslatest

  avdmanager.bat -s create avd -c 2000M -k "system-images;android-28;default;x86_64" -n "avd_1"

  检查AVD

  avdmanager.bat list avd

9.QT中设置

打开QT Createor

进入菜单栏【Tools】【Options】【Devices】,

10.备注问题:
  1. 参考网址

android sdk命令行工具

https://developer.android.google./studio/build/maven-publish-plugin

  1. APK的ABI编译选择,

  1. build.gradle仓库替代

阿里云Maven仓库https://developer.aliyun./mvn/guide

maven{ url 'https://maven.aliyun./repository/google'}

maven{ url 'https://maven.aliyun./repository/gradle-plugin'}

maven{ url 'https://maven.aliyun./repository/public'}

maven{ url 'https://maven.aliyun./repository/jcenter'}

Copyright © 2016-2025 www.caominkang.com 曹敏电脑维修网 版权所有 Power by