1

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')}

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

Add the dependency for org.apache.commons.lang3.StringUtils in build.gradle.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.