【问题标题】:Flutter:flutter app doesn't work after build apkFlutter:构建apk后flutter应用程序不起作用
【发布时间】:2020-07-16 04:42:38
【问题描述】:

您好,我终于完成了使用颤振开发我的应用程序,它取决于我开发时的 API 数据我使用我的手机运行它做得很好,但是当我需要使用 communed 输出 apk 时 flutter build apk 我可以显示,但是当使用来自 API 的数据登录应用程序时,我无法正常工作,但是当运行应用程序时,一切正常……有什么问题???

提示我何时构建 apk

You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
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,android-x64
        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,android-x64 --split-per-abi
        Learn more on:  https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
Running Gradle task 'assembleRelease'...                                                                                  Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-1.6.5\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java uses or overrides a deprecated A
PI.
Note: Recompile with -Xlint:deprecation for details.
Removed unused resources: Binary resource data reduced from 46KB to 37KB: Removed 20%
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done                     413.1s (!)
√ Built build\app\outputs\apk\release\app-release.apk (19.3MB).

【问题讨论】:

    标签: flutter apk


    【解决方案1】:

    在 android/app/src/main/AndroidManifest.xml 上添加:

    <uses-permission android:name="android.permission.INTERNET" />
    

    【讨论】:

    • 如果对你有帮助,请采纳为正确答案,以免其他人评论相同内容。
    猜你喜欢
    • 2020-01-10
    • 1970-01-01
    • 2019-02-27
    • 1970-01-01
    • 2021-08-26
    • 2021-04-02
    • 2020-02-16
    • 2018-09-16
    • 2019-07-31
    相关资源
    最近更新 更多