Skip to content Skip to sidebar Skip to footer

Android Studio. Can't Include External Library Properly

I'm trying to add to classpath external library (this one). The way I do it: File -> Project Structure -> Dependencies tab -> Add file dependency. Is that correct? Maven's

Solution 1:

xml pull parser is a part of android framework, remove xmlpull-1.1.3.1.jar and try It might work.

Solution 2:

I fixed it by using exclude option in app/build.gradle, it works fine now.

dependencies {
    .....
    compile ('com.thoughtworks.xstream:xstream:1.4.7'){
        exclude group: 'xmlpull'
    }
}

Solution 3:

How to add external libraries into Android Studio:

  • change Project View from Android to Project.
  • add the external library into the directory of "libs" of the project you want put the jar file into.
  • select the "libs/xxx.jar" and right-click, select "Add as a library".

Then check dependencies of build.gradle, you will find jar file is added successfully.

Post a Comment for "Android Studio. Can't Include External Library Properly"