com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/maven/com.fasterxml.jackson.core/jackson-databind/pom.xml
Instead of this
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
try this
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
and more thing
Remove this line
apply plugin: 'com.google.gms.google-services'
from Bottom and add to Top after this apply plugin: 'com.android.application'
.
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
Update :
just remove
compile fileTree(dir: 'libs', include: '*.jar')
and apply dependencies.
Duplicate files copied in APK META-INF/maven/com.squareup/otto/pom.xml
Add to build.gradle:
android {
...
packagingOptions {
exclude 'META-INF/maven/com.squareup/otto/pom.xml'
}
Also, instead of exclude you could use pickFirst
Android Gradle Duplicate files copied in APK META-INF/license.txt
Write below lines in your app level gradle file
android {
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
}
Getting error like duplicate Duplicate files copied in APK META-INF/LICENSE
Try with
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
Then Clean-Rebuild And Run
FYI
You are getting
DuplicateFileException: Duplicate files copied in APK
Make sure Same dependencies are calling or not .
Comment
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile "org.apache.httpcomponents:httpcore:4.2.4"
compile "org.apache.httpcomponents:httpmime:4.3"
DO
compile group: 'org.apache.httpcomponents', name: 'httpclient-android', version: '4.3.5.1'
compile 'org.apache.httpcomponents:httpmime:4.3.5'
Related Topics
How to Integrate Opencv 4.0 into a Pure C++ Android Ndk Project
Android 4.0.1 Breaks Webview HTML 5 Local Storage
Disabling Android's Chrome Pull-Down-To-Refresh Feature
How to Know If a Specific User Has Rated a Android App
Android Webview Cannot Render Youtube Video Embedded via Iframe
Using Collate in Android Sqlite - Locales Is Ignored in Like Statement
How to Parse JSON Array Without Any Object in Retrofit
Android - Activity Not Found Exception
Gstreamer Examples in Android Studio
Placeholder Text for an Input Type="Number" Does Not Show in Webkit Ics
Android - Multiple Custom Versions of The Same App
How to Highlight the Table Row on Click
Bordercolor Not Picking The Lineargradient Color on Android
Using Videoview for Streaming or Progressive-Download Video
Scaling a Phonegap App for Different Android Screen Sizes/Densities
Black Screen Before Splash Screen Appear in Android
What Is More Efficient? Static, Data Passing, Shared Preferences, Database...