uniapp Android offline packaging steps

1. Android offline SDK download

Android Offline SDK - Official Version (Note: The version used by HBuilderX should be consistent with the downloaded sdk version)

2. Download Android Studio

Android Studio download file (note: the version should be above 4.0)

3. Prepare the Android signature certificate file, generally the company will provide it, if not, the process is as follows:

Type 1: Manually generate by yourself
Type 2: Automatically generated by Dcloud Developer Center
Attachment: How to generate an Android cloud certificate for uniapp Android offline packaging

4. Unzip the downloaded Android offline SDK, find the HBuilder-Integrate-AS folder, enter HBuilder-Integrate-AS\simpleDemo\src\main\assets\apps , delete the original files under the apps folder


5. Open the project with the HBuildX editor, and operate Publish -> Native APP Local Package -> Generate Local Package APP Resource

Please add a picture description
Please add a picture description

6. Copy the entire __UNI__XXXX folder resource package of unpackage/resources/__UNI__XXXX above to HBuilder-Integrate-AS\simpleDemo\src\main\assets\apps


7. Open Android studio and import the HBuilder-Integrate-AS folder as a new project

Note: The path where the file is stored should not have a Chinese file name, otherwise an error will be reported when packaging later


Please add a picture description

8. In the simpleDemo/src/main/assets/data/dcloud_control.xml file, modify the appid to __UNI__XXXX of your own project


Please add a picture description

9. Configure the project package name under simpleDemo/build.gradle and simpleDemo/src/main/AndroidManifest.xml , the format of the package name is XXX.XXX.XXX


Please add a picture description

Please add a picture description

10. Put the previously generated APP Key into simpleDemo /src/main/AndroidManifest.xml


Please add a picture description

11. Under simpleDemo/build.gradle , configure keyAlias ​​(package name, uniapp application ID) keyPassword and storePassword are cloud certificate passwords


Please add a picture description

12. Download the previously generated Android cloud certificate file, rename it, and put it in the simpleDemo folder


Please add a picture description

13. Generate signature file

Note: If the Android Studio package does not have the Generate Signed Bundle/APK option, please refer to the following article to configure

The latest solution to Android Studio packaging has no Generate Signed Bundle/APK option


Please add a picture description
Please add a picture description


Fill in the following information truthfully, where Key store path is the storage path of the cloud certificate, password is the password of the cloud certificate, key alias is the directory name (uniapp application identifier), click Next and finally select release, and click Finish to enter the packaging state


Please add a picture description


. The packaged file is placed in the release directory and the name is simpleDemo-release.apk


Please add a picture description
Please add a picture description

The above is the whole content of uniapp Android offline packaging steps ! , if you think it is helpful to you, like + follow + bookmark~, we are on the front-end road together, and work hard together! Go, go, go! ! !

Guess you like

Origin blog.csdn.net/weixin_44120523/article/details/129378237