Flutter打包apk报错:Your app isn't using AndroidX.

简介: Flutter打包apk报错:Your app isn't using AndroidX.

今天在学习Flutter开发的过程中,写了一个基本的demo,想打个正式的安装包apk,安装在手机上体验一下效果。

配置完了Android的签名文件后,运行Flutter bulid app命令行,构建一个正式(release)包,在构建的过程中出现了如下的提示,但是可以构建成功。

[!] Your app isn't using AndroidX.
    To avoid potential build failures, you can quickly migrate your app by following the steps on https://goo.gl/CP92wY.

微信图片_20220609220404.png

构建成功后的包在Android Studio IDE上是找不到的😀, 需要进入文件目录中找到你的项目,打包好的项目就在:

打包好的APK位于<app dir>/build/app/outputs/apk/app-release.apk。

但是有这个提示总是不爽的,是吧,想办法解决掉它。

根据提示应该可以看出,当前咱们的的项目没有使用AndroidX, 这个AndroidX是Android系统的极大的提升,所以说也是比较重要的。

AndroidX is a major improvement to the original Android Support Library.
It provides the androidx.* package libraries, unbundled from the platform API. This means that it offers backward compatibility and is updated more frequently than the Android platform.

在Flutter官网的说明中也专门提到了AndroidX Migration的迁移问题,通过问答的方式给出了一些对应的解决方案。

对于此项目构建Apk提示问题,只需要添加两行代码即可解决。

在gradle.properties中添加如下代码即可:

android.enableJetifier=true
android.useAndroidX=true

微信图片_20220609220520.png

添加完之后,重新使用命令行:flutter build apk 就可以了,就不会出现上面那个提示了。

提示:

如果你已经在手机上安装了调试版的APP,安装正式版的APP之前要记得把原来debug的APP卸载掉。

目录
相关文章
|
23天前
|
存储 BI Android开发
全开源仿第八区H5APP封装打包分发系统源码
全开源仿第八区H5APP封装打包分发系统源码
83 4
|
26天前
【Azure Logic App】使用Outlook.com发送邮件遇到429报错
【Azure Logic App】使用Outlook.com发送邮件遇到429报错
|
26天前
|
开发工具 git
【Azure App Service】App Service设置访问限制后,使用git clone代码库出现403报错
【Azure App Service】App Service设置访问限制后,使用git clone代码库出现403报错
|
26天前
|
开发框架 .NET Windows
【App Service】在App Service中配置Virtual applications and directories,访问目录中的静态文件报错404
【App Service】在App Service中配置Virtual applications and directories,访问目录中的静态文件报错404
|
26天前
|
缓存
【Azure Function】Function App代码中使用Managed Identity认证获取Blob数据时遇见400报错
【Azure Function】Function App代码中使用Managed Identity认证获取Blob数据时遇见400报错
【Azure Function】Function App代码中使用Managed Identity认证获取Blob数据时遇见400报错
|
26天前
|
安全 前端开发 网络安全
【Azure App Service】访问App Service应用报错 SSL: WRONG_VERSION_NUMBER
【Azure App Service】访问App Service应用报错 SSL: WRONG_VERSION_NUMBER
|
26天前
|
Shell PHP Windows
【Azure App Service】Web Job 报错 UNC paths are not supported. Defaulting to Windows directory.
【Azure App Service】Web Job 报错 UNC paths are not supported. Defaulting to Windows directory.
|
26天前
|
存储 网络安全 数据中心
【Azure 应用服务】Function App / App Service 连接 Blob 报错
【Azure 应用服务】Function App / App Service 连接 Blob 报错
|
27天前
|
关系型数据库 MySQL Java
【Azure 应用服务】App Service 无法连接到Azure MySQL服务,报错:com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
【Azure 应用服务】App Service 无法连接到Azure MySQL服务,报错:com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
130 0
|
27天前
【Azure 应用服务】App Service下部署的应用报错 Out of Memory
【Azure 应用服务】App Service下部署的应用报错 Out of Memory

热门文章

最新文章