【问题标题】:Flutter apk doesn't work in android deviceFlutter apk 在 android 设备中不起作用
【发布时间】:2021-04-06 22:30:46
【问题描述】:

我尝试为我的颤振应用程序生成 apk 文件,我在flutter clean 命令之后使用了flutter build apk --release 命令。 请注意,使用flutter build apk --release 命令后出现此错误:

Note: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\android_intent-0.3.7+3\android\src\main\java\io\flutter\plugins\androidintent\MethodCallHandlerImpl.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher-5.4.5\android\src\main\java\io\flutter\plugins\urllauncher\WebViewActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

之后,我从这个路径获得了 apk 文件:C:\project_path\build\app\outputs\apk\release,但是当我尝试从手机安装这个 apk 时,我得到了这个 app not installed

注意:我尝试过不止一台具有不同 Android 版本的设备。

请帮我解决我的问题。

【问题讨论】:

    标签: android flutter apk


    【解决方案1】:

    似乎是警告,而不是错误,因此应该生成 apk。

    无论如何,你检查过硬件架构吗?

    例如,尝试为您的智能手机指定架构:

    flutter build apk --target-platform android-arm64

    flutter build apk --target-platform android-arm (

    等等……

    【讨论】:

    • 嗨 @Mike,我的智能手机 64 位 ARMv8-A 我已经尝试过这个命令(flutter build apk --target-platform android-arm64),但我仍然得到“未安装应用程序”。
    • 我不知道,你可以构建apk,并将其复制到GDrive并在智能手机上手动安装它,它可以工作。如果您的智能手机使用 USB 数据线连接到 PC,那么简单的 flutter run 应该可以工作:flutter run 会在调试模式下将应用程序安装到您的设备(使用 flutter devices 选择智能手机)。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-02-08
    • 2020-07-03
    • 1970-01-01
    • 1970-01-01
    • 2022-01-03
    • 1970-01-01
    • 2013-03-18
    相关资源
    最近更新 更多