Reputation: 8978
I'm trying to import roottools from here: https://code.google.com/p/roottools/ (jar file) to the Android Studio project. So far I've tried the following:
But still I don't have "acces" to it's methods. Is it possible that is only compatible with Eclipse?
Upvotes: 3
Views: 2977
Reputation: 17083
I tried using the JAR available for download and it didn't work either. To get this working, I had to download the project available at github here. Compile and run the task "makeJar" (right click on task makeJar in the gradle.build and select run).
I just added this new jar in the libs and referenced in the gradle.build file.
dependencies {
...
compile files('libs/RootTools.jar')
}
or you can add it via Project Properties.
It worked perfectly (don't forget to sync your the gradle files if you edit it manually).
Upvotes: 5
Reputation: 80020
In your project, choose File menu > Project Structure (there's a bug in 0.4.4 and this menu item won't have a title at all; it still works) > Modules > choose your module > Dependencies > + button > File dependency > choose your library from the file picker. That file needs to be somewhere beneath the root directory of your projet; the libs directory is fine.
Screenshot of the Project Structure dialog:
Upvotes: 2