I have added maven publish to my library project that is working fine and it's generating .aar file inside .m2/repository Now I am trying to add that library into my app project but it give errors.
here's my build.gradle(app's)
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath 'com.google.gms:google-services:4.3.3'
classpath 'com.google.firebase:perf-plugin:1.3.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
mavenCentral()
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and common.gradle (where I implemented that library) like this
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
// Use project(":libraryName") if you need to test changes to library in development.
implementation project(":libraryName")
}
Errors I am getting
ERROR: Unable to resolve dependency for ':mobile@prodDebugUnitTest/compileClasspath': Failed to transform artifact 'library.aar (project :libraryName)' to match attributes {artifactType=jar}.