当前位置:网站首页>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 .
边栏推荐
- Countdowncatch and completabilefuture and cyclicbarrier
- 深度学习编译器的理解
- C# Winform程序界面优化实例
- Digital intelligent supplier management system solution for coal industry: data driven, supplier intelligent platform helps enterprises reduce costs and increase efficiency
- Small program container technology to promote the operation efficiency of the park
- The easynvr platform equipment channels are all online. What is the reason for the "network request failure" in the operation?
- 屏幕显示技术进化史
- NFT technology for gamefi chain game system development
- 【合集- 行业解决方案】如何搭建高性能的数据加速与数据编排平台
- Compilation problems and solutions of teamtalk winclient
猜你喜欢

MRO industrial products procurement management system: enable MRO enterprise procurement nodes to build a new digital procurement system

Vulnerability recurrence ----- 38. Thinkphp5 5.0.23 Remote Code Execution Vulnerability

Dependencies tool to view exe and DLL dependencies

The easynvr platform equipment channels are all online. What is the reason for the "network request failure" in the operation?

Swin-Transformer(2021-08)

Detailed single case mode

LeetCode之合并二叉树

Do you write API documents or code first?

如何利用AI技术优化独立站客服系统?听听专家怎么说!

TCP粘包问题
随机推荐
Four tips tell you how to use SMS to promote business sales?
电子元器件行业在线采购系统精准匹配采购需求,撬动电子产业数字化发展
MySQL找不到mysql.sock文件的臨時解
国内离线安装 Chrome 扩展程序的方法总结
Apple Watch无法开机怎么办?苹果手表不能开机解决方法!
Do you really understand the persistence mechanism of redis?
Is it safe to open an account for goucai? Is it reliable?
iCloud照片无法上传或同步怎么办?
Vulnerability recurrence ----- 38. Thinkphp5 5.0.23 Remote Code Execution Vulnerability
煤炭行业数智化供应商管理系统解决方案:数据驱动,供应商智慧平台助力企业降本增效
剑指 Offer 17. 打印从1到最大的n位数
深度学习编译器的理解
Troubleshooting MySQL for update deadlock
Teach you to quickly set up a live studio in 30 minutes
torch stack() meshgrid()
Dependencies tool to view exe and DLL dependencies
Compare the audio librosa library with the Mel spectrogram in the torchaudio library
Vulnerability recurrence ----37. Apache unomi Remote Code Execution Vulnerability (cve-2020-13942)
小程序容器技术,促进园区运营效率提升
MySQL cannot find mysql Temporary solution of sock file