安卓工程中导入flutter module报错
来源:11-3 Flutter Android混合开发实战-集成与调用【Android技术与Flutter融合】
伊187
2024-03-30
flutter版本:Flutter stable, 3.19.3
gradle版本
在安卓工程settings.gradle中添加了以下代码
报错信息:
Caused by: org.gradle.api.InvalidUserCodeException: Build was configured to prefer settings repositories over project repositories but repository ‘maven’ was added by plugin class ‘FlutterPlugin’
You are applying Flutter’s main Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/go/flutter-gradle-plugin-apply
2回答
-
伊187
提问者
2024-04-01
我按照下图中重新配置了下安卓工程的settings.gradle和build.gradle文件。可以正常导入flutter工程,但是有警告。不知道大家有没有更好的方法
012024-04-02 -
CrazyCodeBoy
2024-04-01
检查下你配置的路径是否正确012024-04-01
相似问题