하는 김에 이번엔 aar 파일을 만들어보겠습니다.


aar파일을 만들기 원하는 프로젝트의 build.gradle에 들어가셔서, 아래 소스를 써주시면 됩니다.

buildTypes {

      release {

            libraryVariants.all { variant ->

                  variant.outputs.each { output ->

                        def outputFile = output.outputFile

                        if (outputFile != null && outputFile.name.endsWith('.aar')) {

                              def fileName = "CreabySampleLibrary.aar"

                              output.outputFile = new File(outputFile.parent, fileName)

                        }

                  }

            }

       }


혹시 오타 났을까봐;; 이미지로도 올리겠습니다.



이렇게 작성 후 빌드하시면 build -> output 폴더가 생성되면서 aar파일이 있을겁니다.

그걸 그대로 사용하시면 됩니다.

+ Recent posts