0

I am trying to create a Java application that reads tweets from my account, stores them into a database and retrieves the tweet data. I am using the Twitter4j library, however, every time I build and run my program I am receiving this error:

Error:Gradle: Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE.txt
File1: /Users/paulmbw/.gradle/caches/modules-2/files-2.1/org.twitter4j/twitter4j-core/4.0.4/1f3c896c7b2f20c51103078ccf0bc2ea97ac012a/twitter4j-core-4.0.4.jar
File2: /Users/paulmbw/.gradle/caches/modules-2/files-2.1/org.twitter4j/twitter4j-stream/4.0.4/e9c442a779c65cef8872e8676bf693ad88379086/twitter4j-stream-4.0.4.jar

Here is what my build.gradle look file looks like:

buildscript {
repositories {
    maven { url 'https://maven.fabric.io/public' }
}

dependencies {
    classpath 'io.fabric.tools:gradle:1.+'
    }
}
  apply plugin: 'com.android.application'
 apply plugin: 'io.fabric'

repositories {
maven { url 'https://maven.fabric.io/public' }
}


android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
    applicationId "com.example.paulmbw.myapplication"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    multiDexEnabled true

}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.google.android.gms:play-services-ads:8.4.0'
compile 'com.google.android.gms:play-services-identity:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'org.twitter4j:twitter4j-core:4.0.4'
compile 'org.mongodb:mongo-java-driver:3.2.2'
compile 'org.twitter4j:twitter4j-stream:4.0.4'
compile 'com.google.code.gson:gson:2.6.2'
}

I have seen similar questions to this and others have suggested I am have unused dependencies, however I do believe I am using all of the entries listed above. What I'm I doing wrong?

Your help will be greatly appreciated.

archon101
  • 1
  • 1
  • 2

0 Answers0