简体   繁体   中英

Importing roottools.jar into Android Studio

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:

  • copy RootTools-javadoc-3.4.jar into libs directory under my project.
  • Add imports
  • Reorganize imports.
  • Rebuild project

But still I don't have "acces" to it's methods. Is it possible that is only compatible with Eclipse?

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).

In your project, choose menu > (there's a bug in 0.4.4 and this menu item won't have a title at all; it still works) > > choose your module > > + button > > choose your library from the file picker. 菜单> (0.4.4中有一个错误,此菜单项根本没有标题;它仍然有效)> >选择模块> > +按钮> >从文件选择器中选择您的库。 That file needs to be somewhere beneath the root directory of your projet; the directory is fine. 目录没问题。

Screenshot of the Project Structure dialog:

项目结构显示模块>依赖关系>文件依赖关系

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM