简体   繁体   English

Flutter apk 在 android 设备中不起作用

[英]Flutter apk doesn't work in android device

I try to generate apk file for my flutter app, I used flutter build apk --release command after flutter clean command.我尝试为我的 flutter 应用程序生成 apk 文件,我在flutter clean命令之后使用flutter build apk --release命令。 note that after used flutter build apk --release command I got this error:请注意,使用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.

After that, I got the apk file from this path: C:\project_path\build\app\outputs\apk\release , but when I try to install this apk from the mobile I got this app not installed :之后,我从这个路径获得了 apk 文件: C:\project_path\build\app\outputs\apk\release ,但是当我尝试从手机安装这个 apk 时,我app not installed

在此处输入图像描述

note: I'm tried more than one device with a different android version.注意:我尝试过不止一种设备具有不同的 android 版本。

Please help me to solve my problem.请帮我解决我的问题。

Seems to be warnings, not errors, thus the apk should be generated.似乎是警告,而不是错误,因此应该生成 apk。

In any case, did you check the hardware architecture?无论如何,您是否检查了硬件架构?

For example, try to specify the architecture for your smartphone:例如,尝试为您的智能手机指定架构:

flutter build apk --target-platform android-arm64 flutter 构建 apk --target-platform android-arm64

flutter build apk --target-platform android-arm ( <-- arm 32 bits) flutter 构建 apk --target-platform android-arm (<-- arm 32 位)

etc... ETC...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM