Search code examples
javaandroid-studioimportscichart

Very similar imports - did I add this dependency twice somehow?


I'm trying to setup the Scichart libraries using this guide.

The library I downloaded has a structure that looks like this:

enter image description here

I copied the 5 .aar files and the 4 documentation .jar files into the libs folder of the app in Android Studio, like so:

enter image description here

Following a guide I read online (I've never added an external library before) I found that for the documentation to work I'd need to add it as an attachment here:

enter image description here

However, when I right clicked and went to library properties it looked like it already had it - I assume that since the files are in the lib folder in the app they're seen and used.

So, everything should work. The problem is that Android Studio is offering to import one of two classes with the exact same package name but different Gradle packages (? don't know if that's the right term) on the right. Picture:

enter image description here

Why is it doing this? What did I do wrong when adding the library?


Solution

  • Per tutorial (Tutorial 01), the sections

    • Using Maven (well it's more Gradle)
    • Using bare SciChart libs

    Are mutually exclusive.
    If you already referenced their libraries via build.gradle (as described in the tutorial, Using Maven part), you don't need (and don't have) to put JAR(s) inside any folder and then add them to the Module settings, or whatever. Even sources will be pulled down automatically.

    What you're doing is creating a local repository, in addition to using the remote one. That's why the duplicated libraries.