Problem:
When you add a third-party dependency, you encounter a deplicatefileexception, which is a duplicate file exception,
How to resolve:
Because it is a new project, it is basically impossible to duplicate the jar package, so the search on the Internet, the answer is a bunch of search, said to be in the Gradle Android under the add
packagingOptions {
exclude ‘META-INF/LICENSE.txt‘
exclude ‘META-INF/LICENSE‘
exclude ‘META-INF/NOTICE.txt‘
exclude ‘META-INF/ASL2.0‘
}
The problem is that online methods are said to be added under the Gradle of the app, try the next invalid, in the dependent Lib Gradle added, problem solving ~~!
Other
If it is still not resolved, then you can carefully look at the red box in the end is what, just add the corresponding name just fine.
Android Development encounters the pit-----add dependencies encountered duplicatefileexception