Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Studio运行错误 #53

Open
wuxi889 opened this issue Oct 31, 2019 · 6 comments
Open

Android Studio运行错误 #53

wuxi889 opened this issue Oct 31, 2019 · 6 comments

Comments

@wuxi889
Copy link

wuxi889 commented Oct 31, 2019

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

@kaina404
Copy link
Owner

尝试clean一下

@wuxi889
Copy link
Author

wuxi889 commented Oct 31, 2019

尝试clean一下

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

@my9988
Copy link

my9988 commented Nov 2, 2019

me too

@orliXdx
Copy link

orliXdx commented Dec 24, 2019

me too, 请问如何解决?

@orliXdx
Copy link

orliXdx commented Dec 24, 2019

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

@Liu1024
Copy link

Liu1024 commented Dec 26, 2019

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants