AAR in Eclipse ANT project

后端 未结 4 1630
半阙折子戏
半阙折子戏 2020-12-03 03:22

is there any way to use .aar library (with resources) in eclipse ant project? I know that there is no simply way to use .aar format like in gradle, but maybe there is some w

4条回答
  •  借酒劲吻你
    2020-12-03 03:57

    The brunt of the work can be done by a wonderful script called deaar. The gist explains things, but basically you run:

    ruby deaar.rb [path/to/aar] [output_directory] 
    

    It outputs an almost ready to use library. Next, you need to run:

    cd [output_directory]
    android update lib-project -p . -t android-xx 
    

    Replace xx with the Android version you're targeting. Now put that directory where your build.xml and project.properties are. Finally, add a line like this to your project.properties:

    android.library.reference.1=./output_directory 
    

    Replace the directory name with the one you created. You can use ".2" and so on for additional libraries. And that's it!

提交回复
热议问题