FlutterDouBan
FlutterDouBan copied to clipboard
Android Studio运行错误
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
More than one file was found with OS independent path 'META-INF/proguard/androidx-annotations.pro'
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more
log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 5s
AndroidX incompatibilities may have caused this build to fail.
Please migrate your app to AndroidX. See https://goo.gl/CP92wY.
Finished with error: Gradle task assembleDebug failed with exit code 1
这个错误结果谷歌了半天,答案全是讲解的在 build.gradle 中添加以下代码,但并非针对 flutter 的,操作了也是无效
packagingOptions { exclude 'META-INF/proguard/androidx-annotations.pro' }
尝试clean一下
尝试clean一下
没有效果,版本是ANDROID 10.0(Q)
me too
me too, 请问如何解决?
me too, 请问如何解决?
Solution: All you have to do to fix this is to add this to the android { } section in your app's 'build.gradle'
packagingOptions { exclude 'META-INF/proguard/androidx-annotations.pro' }
+1