'programmer/android'에 해당되는 글 60건

  1. 2016.10.18 AAR library in Android Studio

Reference : http://stackoverflow.com/questions/16682847/how-to-manually-include-external-aar-package-using-new-gradle-android-build-syst




=================================================

확인된 방법 1


Please follow below steps to get it working ( I have tested it up to Android Studio 2.2)

Lets say you have kept aar file in libs folder. ( assume file name is cards.aar )

then in app build.gradle specify following and click sync project with Gradle files.

allprojects {
   repositories {
      jcenter()
      flatDir {
        dirs 'libs'
      }
   }
}

dependencies {
    compile(name:'cards', ext:'aar')
}

If everything goes well you will see library entry is made in build -> exploded-aar

Also note that if you are importing a .aar file from another project that has dependencies you'll need to include these in your build.gradle, too.

=================================================

확인된 방법 2

  1. Right click on your project and choose "Open Module Settings".

Open module settings

  1. Click the "+" button in the top left to add a new module.

Add new module

  1. Choose "Import .JAR or .AAR Package" and click the "Next" button.

Import AAR

  1. Find the AAR file using the ellipsis button ("...") beside the "File name" field.

Find AAR file

  1. Keep the app's module selected and click on the Dependencies pane to add the new module as a dependency.

Dependencies pane

  1. Use the "+" button of the dependencies screen and choose "Module dependency".

Add module dependency

  1. Choose the module and click "OK".

Choose module

=================================================


저작자 표시 비영리 변경 금지
신고
크리에이티브 커먼즈 라이선스
Creative Commons License
Posted by ocsoosoo

댓글을 달아 주세요

이전버튼 1 2 3 4 5 6 7 ··· 60 이전버튼

티스토리 툴바