如何修复Android Studio Flutter上的依赖项重复错误? [英] How to fix dependencies duplicate error on Android studio Flutter?
问题描述
您好,目前我正在开发使用颤振& Android Studio上的Dart.
Hello, current I develop use flutter & Dart on Android studio.
但是当我尝试构建时.总是出现消息而构建失败.
but when I try build. always occur message and build fail.
首先,我判断了AndroidX问题. 因此,我尝试更改代码,请参考 https://flutter.dev/docs/开发/packages-and-plugins/androidx-compatibility
first I judged AndroidX problem. so I try change code refer https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility
android/gradle.properties
android.enableJetifier=true
android.useAndroidX=true
并更改了android/app/build.gradle
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.0.2'
}
然后我写命令gradlew build
但这并不能解决.
如何解决此问题?
谢谢.
推荐答案
您可以使用gradlew命令dependencie获得依赖项报告,如下所示:
You can have a dependencies report with the gradlew command dependencie like this :
gradlew app:dependencies > dependencies_report.txt
此任务将报告项目中的所有依赖关系,并导出到项目根目录中的文件中, 然后,您可以从那里搜索重复的组/模块,并在需要的地方使用排除"
This task will report all dependencies in your project and export to a file in the root of your project, Then from there you can search for duplicate group/module and use 'exclude' in your gradle if/where needed
这篇关于如何修复Android Studio Flutter上的依赖项重复错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!