0

Failed to resolve com.androidAffected Modules and com.loopjAffected Modules in android. I have checked with different links but I am confused.

Below is my App build file

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.XXX.XXXX"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}


dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:25.3.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'

    implementation 'com.android.support:cardview v7:25.3.1'
    implementation 'com.github.bumptech.glide:glide:3.6.1'
    implementation 'me.dm7.barcodescanner:zxing:1.8.4'
    implementation 'com.loopj.android:androidasync http:1.4.9'
    implementation 'com.google.code.gson:gson:2.6.2'
    implementation project(':merchantsdk')


    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

MerchantSDK is the aar file which is imported into this project and then I build giving below exceptions Failed to resolve com.androidAffected Modules and Failed to resolve com.loopjAffected Modules

Please help me on this.Thanks in advance.

1 Answer 1

2

If it is an AAR file you can keep it "lib" folder. You can add dependancy for this AAR in build.gradle as follows: -

implementation "packagename of aar:aar filename:@aar"

Replace package name and filename of AAR.

In build.gradle file of main project add this: -

 allprojects {
    repositories {
        flatDir { dirs 'libs' }
        }
}
Sign up to request clarification or add additional context in comments.

7 Comments

Hi Prashant, Thanks for your response I am confused because I have only ".aar" file.How to get package name of that .aar file ?
You can keep it in lib folder and add as an module from file menu also.
Any reference link would be helpful Prashant.
Prashant I have checked with above link 2 ways giving same exception
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.