无法将 Flutter 项目迁移到 AndroidX [英] Unable to migrate Flutter project to AndroidX

查看:53
本文介绍了无法将 Flutter 项目迁移到 AndroidX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Android Studio 中有一个 Flutter 项目.我计划迁移到 AndroidX.每当我执行重构 -> 迁移到 AndroidX 时,Android Studio 都会显示错误消息:

I have a Flutter project in Android Studio. I am planning to migrate to AndroidX. Whenever I do Refactor -> Migrate to AndroidX, Android Studio shows error message:

您需要在模块 build.gradle 中将 compileSdk 设置为至少 28 才能迁移到 AndroidX.

You need to have compileSdk set to at least 28 in your module build.gradle to migrate to AndroidX.

但是我已经在我的 app/gradle.build 文件中设置了 compileSdkVersion 28.

However I have already set the compileSdkVersion 28 in my app/gradle.build file.

还有什么我需要做的吗?

Is there anything else I need to do?

推荐答案

我能够解决我的问题:

  1. 在 Android Studio 中打开 Flutter 项目
  2. 右键点击android目录,点击Flutter->在Android Studio中打开Android模块.它要求我升级我的 gradle 插件.
  3. 然后我安装了 Google Play 服务.工具 -> SDK 管理器 -> SDK 工具并检查 Google Play 服务.

安装 Google Play 服务后,我进行了重构 -> 迁移到 AndroidX.它开始工作了.

After the Google Play Services Installed, I did Refactor -> Migrate to AndroidX. It started working.

注意:从您在步骤 2 中打开的项目窗口进行重构.

Note: Do the refactor from the project window you opened in the step 2.

这篇关于无法将 Flutter 项目迁移到 AndroidX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆