As an excellent cross-platform front-end framework, UNIAPP is easy to use and fast to shape. Uni-app uses vue.js as its development language, which is not too difficult to get started. Since there won’t be much of a problem on the development side, the hardest part will be getting the finished product on the plate. Uniapp also provides two official packaging methods. The first is through the official cloud packaging entry for packaging, the second is to generate packaging resources through the platform tools for packaging.

1. The difference between cloud and offline packaging Exactly there is not much difference between cloud and offline packaging. Cloud packaging Even if the official cloud server has provided the packaging environment, users do not need to set up the local environment for packaging. If you use your own components, or a third party plugin that h5+ Plus doesn’t integrate, or have some other functionality, you should definitely use offline packaging. Since cloud packaging is performed using official cloud servers, it is inevitable that there will be slow packaging. Especially close to work or something! Offline packing does not suffer from this affliction. You can do whatever you want, whenever you want.

2. Cloud packaging cloud packaging reference materials more, everyone a little hand can appear a pile of big guy’s efforts. Here a big guy’s article as a reference: original address

3. Pack offline

I’ll post you a three-hand link first. First Hand: Android Studiodeveloper.android.google.cnSecond hand: Android offline SDK:ask.dcloud.net.cn/article/103Third hand: Official packaging tutorial:Nativesupport.dcloud.net.cn/AppDocs/use…



3.1 Installing Android Studio

After downloading the above two tools, it’s time to install Android Studio. The only thing to watch out for after that is the SDK version.



3.2 Generate offline APP resources for existing projects

Click on the toolbar in HBuilderxPublish -> Native App- Locally packaged -> Generate locally packaged App resources. Finished work



3.3 Decompressing the SDK package downloaded at the second hand

Note that the MD file states that this SDK package needs to be compatible with your current huilderx version





3.4 Import your HBuilder-Hello demo application from package 3.3 into Android Studio and overwrite the demo project



File ->open->The location of your APK package-> hbuilder-hello to package the app resources we generated in 3.2Your Uniapp project file->unpackage-> Resources 】 Replace your Android folder with the folder named after your AppID Studio open project Hbuilder-Hello->app-> SRC ->main-> Assets ->apps helloH5 folder.



3.5 Ensure that the APPids of the three files are the same



Respectively ⅰ :Ⅱ :

Ⅲ :



3.5 Enabling the Custom Component Mode



Open 3.3 Decompressed package and go to the directory SDK->libs. Paste uniapp-release.aar da and put it in the libs file under the current Android Studio directory file. Enable custom component mode, if you use custom component without this uniapp startup is very likely to blank screen oh



3.6 serving



You can preview the little phone by clicking on the Android Studio tools TAB

Click build APk (s) under the Android Studio tools TAB to pack it

And then there isMany packages in this LIBS can be deleted to reduce the packaging volume. Of course, there is no problem with all of them. Do you need to judge by yourself