当前位置:网站首页>Personally test the size of flutter after packaging APK, quite satisfied
Personally test the size of flutter after packaging APK, quite satisfied
2022-06-30 18:56:00 【Yumeimenong】
flutter Although I knew it early , But it hasn't been used yet , Today is the first time to pack Android APK try the size , Because of the choice flutter I must consider the size of his bag , If it's packed apk Than react native I'm sure I won't consider it .
Before packing, I guess apk It should be very big , At least, 30m about , But when I put release package build After coming out , I was shocked , Very satisfied !
First installation flutter SDK yes 3.0.2, It's the latest edition .
Install and configure environment variables PATH after , Reset the command line interface , You can go through flutter doctor The command confirms that the installation has been successful .
flutter doctorAnd then use flutter create learn_flutter
flutter create learn_flutterThe project is created in seconds , This ratio react-native The experience is much better .
Then I started flutter run function , It didn't work ! Probably the error is :
License for package Android SDK Build-Tools 30.0.3 not accepted.
I thought my tools were not installed properly , But I couldn't find it 30.0.3 My tools ! The answers on the Internet are sdk tool Install in , But I can't find 30.0.3 Version of .
Later it was found that flutter Of android sdk Configuration path problem . You should configure the following commands flutter Applied android sdk
flutter config --android-sdk /path/to/android/sdkflutter config --android-studio-dir /path/to/android/studioImportant reminder : Never in android The root file of the project local.properties Middle configuration . I've been tossing around for an hour because of things like the Android project and react native That configuration android sdk route . Every run flutter run command , This configuration has been restored to the incorrect path .
Properly configured android adk After path , You can run it in the simulator , I tried to change the code , Can correctly see the effect in the simulator ! Make sure this step is OK .
I'm going to start build release Version of apk, But I have a new problem , The result is probably that java11 To pack apk.! No matter the , I install java11.
Install well java11 after ( Environment variables replace java8) Need to be in Android engineering gradle.properties Add the following to the file jdk The path of
org.gradle.java.home=path/Java/jdk-11.0.15.1And modify it Android engineering app\build.gradle file .

Okay , Finally, I can build apk 了 .build release apk The following command is required .
flutter build apk --target-platform android-arm,android-arm64flutter build apk --target-platform android-arm,android-arm64 --split-per-abiThe command describes the following :
⾸ First flutter build apk surface ⽰ The current build release package
after ⾯ android-arm,android-arm64,android-x64 It's a designation ⽣ Into a corresponding architecture release package
final --split-per-abi Schedule ⽰ Tell them that they need to be packaged according to the type we specify , If removed, the direct build contains all CPU Architecturally Apk package .
--obfuscate: Enable obfuscation
--split-debug-info=: Will be confused by ⽣ Yes map The symbol table is cached to this location
The first string of commands is packaged armv8a and armv7a The single instruction set of apk It's about 5.8M, I was surprised ! This is small .

The second string of commands is packaged armv8a and armv7a Instruction set and in one apk Its size is 10.6M, I was equally surprised ! Very satisfied !

Finally come to a conclusion ,flutter 3.0 release apk and react native 0.68 release apk It's about the same size .
Pay attention to my station ,www.zchawang.cn, A gadget station .
边栏推荐
- 金融服务行业SaaS项目管理系统解决方案,助力企业挖掘更广阔的增长服务空间
- MRO industrial products procurement management system: enable MRO enterprise procurement nodes to build a new digital procurement system
- MySQL n'a pas pu trouver MySQL. Solution temporaire pour le fichier Sock
- Coding officially entered Tencent conference application market!
- How to use AI technology to optimize the independent station customer service system? Listen to the experts!
- Leader: who can use redis expired monitoring to close orders and get out of here!
- 服务器之间传文件夹,文件夹内容为空
- Sign up for Huawei cloud proposition in the "Internet +" competition, and you can take many gifts!
- countdownlatch 和 completableFuture 和 CyclicBarrier
- NFT挖矿游GameFi链游系统开发搭建
猜你喜欢

OneFlow源码解析:算子签名的自动推断

How to use AI technology to optimize the independent station customer service system? Listen to the experts!

ForkJoinPool

教你30分钟快速搭建直播间

php利用队列解决迷宫问题

System integration project management engineer certification high frequency examination site: prepare project scope management plan

视频内容生产与消费创新

【TiDB】TiCDC canal_ Practical application of JSON

Digital intelligent supplier management system solution for coal industry: data driven, supplier intelligent platform helps enterprises reduce costs and increase efficiency

Deep learning compiler understanding
随机推荐
PyTorch学习(三)
MySQL cannot find mysql Temporary solution of sock file
torch stack() meshgrid()
Small program container technology to promote the operation efficiency of the park
How to use AI technology to optimize the independent station customer service system? Listen to the experts!
电子元器件招标采购商城:优化传统采购业务,提速企业数字化升级
GameFi链游系统开发NFT技术
Tsinghua only ranks third? 2022 release of AI major ranking of Chinese Universities of soft science
slice
分布式事务
PC wechat multi open
NFT technology for gamefi chain game system development
At present, the big guys are joining the two streams of flinksql, cdcmysql and Kafka, and the results are put into MySQL or KA
Four tips tell you how to use SMS to promote business sales?
先写API文档还是先写代码?
TiDB Dashboard里面可以写sql执行吗
MySQL事务并发问题和MVCC机制
一点比较有意思的模块
【TiDB】TiCDC canal_ Practical application of JSON
Openlayers roller shutter map