0

I am extremely inexperienced with Android Studio - and am having an issue with my imports. I'm trying to build an app that creates music from an ArrayList of "note" objects (I've made this class - it has info on). I am trying to import midi driver (https://github.com/billthefarmer/mididriver) to play my music, but I keep getting an error when I try to write this:

import org.billthefarmer.mididriver;

in my code (specifically the Analyzer object I've made - you'll see it in the pic). Here is a pic of my project structure. I've added Midi Driver as a dependency to my build.gradle

implementation project(path: ':org.billthefarmer.mididriver')

in my app folder. I'm not sure what I'm doing wrong. I'm sorry to bother!

Here is the pic of my project structure Here is the pic of my project structure

Bruno
  • 3,872
  • 4
  • 20
  • 37
  • The real answer here: pick any decent tutorial on Android that discuses the usage of 3rd party libraries. – GhostCat May 20 '22 at 13:54
  • Welcome to Stack Overflow! Can you provide a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) and the specific error message to help others better understand what the problem is? – Yang Hanlin May 20 '22 at 13:56

1 Answers1

0

You should add it in MyApp/app/build.gradle like this :

dependencies {
    ....
    implementation 'com.github.billthefarmer:mididriver:v1.24'
    ....
}
Stoica Mircea
  • 782
  • 10
  • 22
  • Thanks! Do you know if there is a way to do this without getting it from github with Maven? I have it imported as a module in my project - can I import that? What would be the syntax? I haven't downloaded Maven for Android, which is why I ask. – fantabulousgoldfun May 21 '22 at 13:46
  • Take the aar from the internet and add it to your libs directory then add in dependencies to compile with all .aar of libs as following: https://stackoverflow.com/a/23326397/5583881 – Stoica Mircea May 21 '22 at 16:24