1
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
    applicationId "jzdevelopers.ml.schoolbinder"
    minSdkVersion 16
    targetSdkVersion 23
    versionCode 1
    versionName "1.0.0"
}

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

packagingOptions {
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
}

}

repositories {
maven { url "https://jitpack.io" }

maven { url "https://s3.amazonaws.com/repo.commonsware.com" }

jcenter()
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:recyclerview-v7:23.2.0'
compile 'com.android.support:cardview-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.melnykov:floatingactionbutton:1.3.0'
compile 'com.commonsware.cwac:richedit:0.5.2'
compile 'org.sufficientlysecure:html-textview:1.4'
compile ('com.github.NightWhistler:HtmlSpanner:0.4')
compile('com.github.afollestad.material-dialogs:core:0.8.5.6@aar') {
    transitive = true
}
compile('com.github.ganfra:material-spinner:1.1.1') {
    exclude group: 'com.nineoldandroids', module: 'library'
    exclude group: 'com.android.support', module: 'appcompat-v7'
}
compile('com.rengwuxian.materialedittext:library:2.1.4') {
    exclude group: 'com.nineoldandroids', module: 'library'
    exclude group: 'com.android.support', module: 'appcompat-v7'
}
  }

Error: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/JordanZimmitti/.gradle/caches/modules-2/files-2.1/org.jdom/jdom/1.1/1d04c0f321ea337f3661cf7ede8f4c6f653a8fdd/jdom-1.1.jar File2: /Users/JordanZimmitti/.gradle/caches/modules-2/files-2.1/org.apache.ant/ant/1.7.0/9746af1a485e50cf18dcb232489032a847067066/ant-1.7.0.jar

Jordan
  • 407
  • 5
  • 20

1 Answers1

2

Use "JitPack", once integrated in gradle enter the link of the user and the name of his github repo. For this specific case, so you should write:

compile 'com.github.NightWhistler:HtmlSpanner:0.4'

Of course in the repositories you add this line, as you will also find the official website

maven { url "https://jitpack.io" }

EDIT

Edit your build.gradle

    apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
    applicationId "jzdevelopers.ml.schoolbinder"
    minSdkVersion 16
    targetSdkVersion 23
    versionCode 1
    versionName "1.0.0"
}

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

packagingOptions {
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/LICENSE.txt'
}

}

repositories {
maven { url "https://jitpack.io" }

maven { url "https://s3.amazonaws.com/repo.commonsware.com" }

jcenter()
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:recyclerview-v7:23.2.0'
compile 'com.android.support:cardview-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.melnykov:floatingactionbutton:1.3.0'
compile 'com.commonsware.cwac:richedit:0.5.2'
compile 'org.sufficientlysecure:html-textview:1.4'
compile 'com.github.NightWhistler:HtmlSpanner:0.4'
compile('com.github.afollestad.material-dialogs:core:0.8.5.6@aar') {
    transitive = true
}
compile('com.github.ganfra:material-spinner:1.1.1') {
    exclude group: 'com.nineoldandroids', module: 'library'
    exclude group: 'com.android.support', module: 'appcompat-v7'
}
compile('com.rengwuxian.materialedittext:library:2.1.4') {
    exclude group: 'com.nineoldandroids', module: 'library'
    exclude group: 'com.android.support', module: 'appcompat-v7'
}
  }
peppinoibra
  • 139
  • 1
  • 10
  • you entered the order of the repositories in maven? Then you entered in the dependency checking compile? if you bring me the error https://jitpack.io/ – peppinoibra Mar 06 '16 at 16:30
  • Test the new compile code: compile 'com.github.nightwhistler:HtmlSpanner:2.16' for the version I'm not sure but the currently described and the page github (version 2.16). – peppinoibra Mar 06 '16 at 16:55
  • here I updated version, now you should go. compile 'com.github.NightWhistler:HtmlSpanner:0.4' – peppinoibra Mar 06 '16 at 17:00
  • your the best! where did you get the 0.4 from i was looking for it – Jordan Mar 06 '16 at 17:05
  • the version you find in the dropdown menu "Branch", to select them "tags" and see the versions – peppinoibra Mar 06 '16 at 17:08
  • add this to buid.gradle in Android{ packagingOptions { exclude 'META-INF/NOTICE' exclude 'META-INF/LICENSE' } } – peppinoibra Mar 06 '16 at 17:13
  • where in the build.gradle do I add that ill re add my build.gradle above – Jordan Mar 06 '16 at 17:16
  • added that but got an error posted it above in update – Jordan Mar 06 '16 at 17:24
  • you have to add the code in the Android tag {} already exists, so you have to add the lines inside. – peppinoibra Mar 06 '16 at 17:27
  • I've inserted directly I rows in your file – peppinoibra Mar 06 '16 at 17:30
  • check update I think I added it correctly stil getting error – Jordan Mar 06 '16 at 17:33
  • I added .txt both license that notice :D – peppinoibra Mar 06 '16 at 17:39
  • Hi peppinoibra I have another question about google drive api on another thread the link is herehttp://stackoverflow.com/questions/35927168/upload-sql-database-to-google-drive-using-drive-api?noredirect=1#comment59513033_35927168 since you did such a good job helping me with this issue I was hoping you could help me with this new one. thanks – Jordan Mar 10 '16 at 23:27