How to include aar files used in library projects in main project in Android

前端 未结 6 2107
名媛妹妹
名媛妹妹 2020-12-31 10:56

My project is including some library project. Library is using some aar files and its dependecny is already defined in the module: gradle file. I am facing problem in includ

6条回答
  •  悲&欢浪女
    2020-12-31 11:18

    For Android studio

    Follow this steps:

    Step 1:

    Import .aar

    File ---> New ---> New Module ---> (select) import .JAR/.AAR package ---> Next --->(select .aar file then)Finish

    Now your existing project is imported.

    Step 2:

    Add dependencies

    File ---> Project Structure ---> (Now you will get module list in left side at bottom.) ---> (Select app module) ---> select dependencies tab ---> click on (+) button ---> select module dependencies ---> (select module which you added) ---> ok ---> ok

    Note: To check dependency is added

    your build.gradle looks like

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        testCompile 'junit:junit:4.12'
        compile 'com.android.support:appcompat-v7:23.2.1'
        compile 'com.android.support:design:23.2.1'
        compile 'com.squareup.picasso:picasso:2.5.0'
        compile project(':ScreenSharingSDK')
    }
    

提交回复
热议问题