[Android Studio] using local AAR files

Source: Internet
Author: User

Exporting AAR

First the Gradle script for the Android Library project only needs to be declared at the beginning

apply plugin: ‘com.android.library‘

After that, and the same method as the export apk file, execute ./gradlew assemblerelease, then you can generate an AAR file in the Build/outputs/aar folder

Referencing a local AAR

1: Make sure that your AAR file does not have a duplicate res for the existing project, including the image name, such as Ic-launcher, String, Dimen, and so on, once the main project references the duplicate resource name, an error will be made.

2:in Build.gradle

Apply plugin: ' Com.android.application 'Android {compilesdkversion22buildtoolsversion"22.0.1"Defaultconfig {ApplicationID"Xxxxxxxxxxx"minsdkversion22targetsdkversion22Versioncode1Versionname"1.0"} buildtypes {release {minifyenabledfalseproguardfiles Getdefaultproguardfile (' Proguard-android.txt '), ' Proguard-rules.pro '}}} repositories {flatdir {dirs ' Libs ' }}dependencies {  Compile (name:' app-release ', ext: ' AAR ')} 

[Android Studio] using local AAR files

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.