Reputation: 61
I am trying to use OpenCSV library in my project and it is throwing up this error- I have already tried to delete the library and reinstall it and the error persists.
This is from the build.gradle
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
testCompile 'junit:junit:4.12'
compile files('libs/opencsv.jar')}
Upvotes: 1
Views: 1566
Reputation: 983
I am curious as to why you have your own opencsv.jar? Is it because you did customizations or do you have firewall issues where you are only allowed to go to an internal maven repository during compilation?
If so Prathmesh hit the nail on the head in that you will have to bring in all the transitive dependencies yourself. The dependencies of the latest version can be found at the opencsv sourceforge page. Currently opencsv is dependent on commons-lang3 and commons-beanutils.
Otherwise just change your "compile files" line to compile 'com.opencsv:opencsv:3.9' and let gradle get all your transitive dependencies for you.
Upvotes: 1
Reputation: 21
Add the dependency for org.apache.commons.lang3.StringUtils in build.gradle.
Upvotes: 0