如何解决Flutter apk 在 android 设备中不起作用
我尝试为我的 Flutter 应用程序生成 apk 文件,我在 flutter build apk --release
命令之后使用了 flutter clean
命令。
请注意,在使用 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 版本的设备。
请帮我解决我的问题。
解决方法
似乎是警告,而不是错误,因此应该生成apk。
无论如何,您是否检查过硬件架构?
例如,尝试为您的智能手机指定架构:
flutter build apk --target-platform android-arm64
flutter build apk --target-platform android-arm (
等等...
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。