Add ".aar" dependency which uses AA, to application module in Android Studio 1.1.0

307 views Asked by At

I am following the post : post but after following that post still I am encounter into error :

Could not find method org.androidannotations.api.view.OnViewChangedNotifier.replaceNotifier, referenced from method MyClass_.getInstance_

My library uses Android Annotations as DI/IoC.

My library module dependencies in .gradle file are :

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.1.1'
    apt "org.androidannotations:androidannotations:3.+"
    compile "org.androidannotations:androidannotations-api:3.+"
    testCompile "junit:junit:4.12"
}

My host App module dependencies in .gradle file are :

repositories {
    flatDir {
        dirs 'libs'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.1.1'
    compile(name: 'my-lib', ext: 'aar') // NOT WORKING  
}

OR

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.1.1'    
    compile project(':my-lib') // NOT WORKING 
}

P.S. The problem is the Test(host/client) app does not recognizes the AA dependency. So you need to add the AA dependency explicitly into the Test app and it works like charm.

But I want to give only my library's AAR archive file to client, so it can be directly used into its app without adding AA dependency. To add the AA jars directly into library module I followed the AA configure guide for Android Studio : AA Configure Guide after this still I got the error for the library module which fails to create the AAR archive. The call to internal methods does not recognized by the library. MyClass_.getInstance_(context); Shows me something like :

  • Note: Some input files use or override a deprecated API.
  • Note: Recompile with -Xlint:deprecation for details.
  • Note: MyClass.java uses unchecked or unsafe operations.
  • Note: Recompile with -Xlint:unchecked for details.
0

There are 0 answers