0

So i've been getting this unexpected top level exception error after adding the jasypt libraries to my project. I've tried a lot of the other fixes suggested in other similar questions to no avail

Here's my gradle build message:

    UNEXPECTED TOP-LEVEL EXCEPTION:
    com.android.dex.DexException: Multiple dex files define Lorg/jasypt/spring/properties/EncryptablePreferencesPlaceholderConfigurer;
    at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
    at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
    at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
    at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
    at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
    at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
    at com.android.dx.command.dexer.Main.run(Main.java:246)
    at com.android.dx.command.dexer.Main.main(Main.java:215)
    at com.android.dx.command.Main.main(Main.java:106)
    Error:Execution failed for task ':app:dexDebug'.
    > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_40\bin\java.exe'' finished with non-zero exit value 2

and here's my build.gradle(app):

apply plugin: 'com.android.application'

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
    applicationId "com.verve.eventfloc"
    minSdkVersion 16
    targetSdkVersion 21
    versionCode 1
    versionName "1.0"
}

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



dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.0.0'


compile files('libs/jasypt-spring31-1.9.2.jar')
compile files('libs/jasypt-springsecurity2-1.9.2.jar')
compile files('libs/jasypt-1.9.2-sources.jar')
compile files('libs/jasypt-spring2-1.9.2-sources.jar')
compile files('libs/jasypt-1.9.2.jar')
compile files('libs/jasypt-hibernate3-1.9.2-javadoc.jar')
compile files('libs/jasypt-spring2-1.9.2.jar')
compile files('libs/jasypt-hibernate3-1.9.2.jar')
compile files('libs/jasypt-spring3-1.9.2-sources.jar')
compile files('libs/jasypt-springsecurity2-1.9.2-sources.jar')
compile files('libs/jasypt-hibernate4-1.9.2-sources.jar')
compile files('libs/jasypt-hibernate4-1.9.2.jar')
compile files('libs/jasypt-springsecurity2-1.9.2-javadoc.jar')
compile files('libs/jasypt-acegisecurity-1.9.2-javadoc.jar')
compile files('libs/jasypt-hibernate3-1.9.2-sources.jar')
compile files('libs/icu4j-3.4.4.jar')
compile files('libs/jasypt-1.9.2-javadoc.jar')
compile files('libs/jasypt-1.9.2-lite.jar')
compile files('libs/jasypt-spring31-1.9.2-javadoc.jar')
compile files('libs/jasypt-acegisecurity-1.9.2-sources.jar')
compile files('libs/jasypt-springsecurity3-1.9.2-javadoc.jar')
compile files('libs/jasypt-spring3-1.9.2-javadoc.jar')
compile files('libs/jasypt-spring31-1.9.2-sources.jar')
compile files('libs/jasypt-spring3-1.9.2.jar')
compile files('libs/jasypt-springsecurity3-1.9.2-sources.jar')
compile files('libs/jasypt-acegisecurity-1.9.2.jar')
compile files('libs/jasypt-springsecurity3-1.9.2.jar')
compile files('libs/jasypt-wicket13-1.9.2.jar')
compile files('libs/jasypt-spring2-1.9.2-javadoc.jar')
compile files('libs/jasypt-hibernate4-1.9.2-javadoc.jar')
compile files('libs/jasypt-wicket13-1.9.2-sources.jar')
compile files('libs/jasypt-wicket13-1.9.2-javadoc.jar')
compile files('libs/jasypt-wicket15-1.9.2.jar')
compile files('libs/jasypt-wicket15-1.9.2-javadoc.jar')
compile files('libs/jasypt-wicket15-1.9.2-sources.jar')
}

I tried adding an exclusion in the build.gradle as per this question but I then get prompts to implement the getSupportFragmentManager() method in my class.

When I alt-enter again for the suggestion, it tells me to import fragment manager and then to return android.support.v4.app.FragmentManager in getSupportFragmentManager(). It also seems to mess up Context whenever i've used ".this"

Any help will be greatly appreciated. Thanks

Community
  • 1
  • 1
vn2456
  • 19
  • 3
  • please, read the link that you provide with understanding ... *If you have more then one support libs included in the dependencies like this, you may want to ...* now what happend if words "support libs" will become "the same libs" ... – Selvin May 08 '15 at 09:01
  • I'm not sure I understand what you're saying. I'm very new to android studio and pretty new to java in general. Did I import too many/the wrong libraries? I just copied the entire contents of the lib folder in the Jasypt file I downloaded into my project file. – vn2456 May 08 '15 at 09:10
  • obviously, error means that something is copiled more than once ... obviously, `compile fileTree(include: ['*.jar'], dir: 'libs')` means "compile into project all jar's files from `libs` folder **implicitly**" ... and finally, fx: `compile into project files('libs/jasypt-spring31-1.9.2.jar')` obviously means "compile `jasypt-spring31-1.9.2.jar` from `libs` folder **explicitly**" ... now add 1+1+1 ... – Selvin May 08 '15 at 09:18
  • OK, I've just realised what I've done. That was pretty stupid of me. Thanks for the help! Fixed it – vn2456 May 08 '15 at 09:36

0 Answers0