FlutterDouBan icon indicating copy to clipboard operation
FlutterDouBan copied to clipboard

Android Studio运行错误

Open wuxi889 opened this issue 5 years ago • 6 comments

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' }

wuxi889 avatar Oct 31 '19 07:10 wuxi889

尝试clean一下

kaina404 avatar Oct 31 '19 08:10 kaina404

尝试clean一下

没有效果,版本是ANDROID 10.0(Q)

wuxi889 avatar Oct 31 '19 08:10 wuxi889

me too

my9988 avatar Nov 02 '19 08:11 my9988

me too, 请问如何解决?

orliXdx avatar Dec 24 '19 07:12 orliXdx

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' }

orliXdx avatar Dec 24 '19 08:12 orliXdx

+1

Liu1024 avatar Dec 26 '19 11:12 Liu1024