无法将Flutter项目迁移到AndroidX [英] Unable to migrate Flutter project to 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.
还有什么需要做的吗?
推荐答案
我能够解决我的问题:
- 将Flutter项目打开到Android Studio中
- 右键单击android目录,单击Flutter->在Android Studio中打开Android模块.它要求我升级gradle插件.
- 然后,我安装了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屋!