最近我一直在编写一个名为app002的应用程序,但我遇到了一些问题,我需要知道如何解决这些问题,我使用GitBash作为终端
颤振博士
lamoh@DESKTOP-QUA3N6C MINGW64 /e/programes/Flutter_Req/sourceCode
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.9.1+hotfix.6, on Microsoft Windows [Version 10.0.15063], locale ar-DZ)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[√] Android Studio (version 3.5)
[√] VS Code, 64-bit edition (version 1.40.2)
[!] Connected device
! No devices available
! Doctor found issues in 1 category.这条戒律花了太多的时间,没有被训斥。
颤振构建apk
elamoh@DESKTOP-QUA3N6C MINGW64 /e/programes/Flutter_Req/sourceCode/app002
$ flutter build apk
You are building a fat APK that includes binaries for android-arm, android-arm64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
To generate an app bundle, run:
flutter build appbundle --target-platform android-arm,android-arm64
Learn more on: https://developer.android.com/guide/app-bundle
To split the APKs per ABI, run:
flutter build apk --target-platform android-arm,android-arm64 --split-per-abi
Learn more on: https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
Initializing gradle... 2,0s
Resolving dependencies...我也试过但什么也没做
$颤振构建应用程序包-目标平台android-arm,android-arm64
lamoh@DESKTOP-QUA3N6C MINGW64 /e/programes/Flutter_Req/sourceCode/app002
**$ flutter build appbundle --target-platform android-arm,android-arm64**
Initializing gradle... 2,3s
Resolving dependencies...在项目目录中创建了一个名为build的文件夹,但在其中只有app.dill文件存在。没有apk没有iOs文件
救命啊!谢谢
发布于 2019-12-10 07:55:03
您需要运行flutter build apk而不是appbundle。一个应用程序包将被发送到Google,它将为您生成和优化apk。完成后,apk将位于build\app\outputs\bundle\release\文件夹中。
发布于 2019-12-10 07:53:06
最后花了很长时间,但还是谢谢
PS E:\programes\Flutter_Req\sourceCode\app003> flutter build appbundle --target-platform android-arm,android-arm64
Running "flutter pub get" in app003... 8,9s
Initializing gradle... 6,4s
Resolving dependencies...
520,4s (!)
Running Gradle task 'bundleRelease'...
Running Gradle task 'bundleRelease'... Done 314,3s (!)
Built build\app\outputs\bundle\release\app.aab (10.5MB).在那里我可以找到APK文件!
发布于 2021-07-09 16:19:06
您的应用程序太大了,要缩小它的大小,请运行以下命令
flutter build appbundle --target-platform android-arm,android-arm64,android-x64然后运行这个
flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abihttps://stackoverflow.com/questions/59257250
复制相似问题