I am trying to build a React Native Package which uses an .aar file for the Android. The .aar file is for internal usage only, thus not shared on a public maven repo. I’ve created the maven repo inside this directory: my-library/android. When I try to build an example app I get an error that the it cannot resolve the library. The my-library/android/build.gradle file looks like this:
buildscript {
...
repositories {
google()
mavenCentral()
maven {
url = uri("${rootProject.projectDir}/maven-repo")
}
}
}
...
repositories {
mavenCentral()
google()
maven {
url = uri("${rootProject.projectDir}/maven-repo")
}
}
dependencies {
implementation("com.mylibrary:localoperationsdk:1.0.0@aar")
}
...
This is the error that I am getting:
Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
> Could not find com.mylibrary:localoperationsdk:1.0.0.
Searched in the following locations:
- https://oss.sonatype.org/content/repositories/snapshots/com/mylibrary/localoperationsdk/1.0.0/localoperationsdk-1.0.0.pom
- https://repo.maven.apache.org/maven2/com/mylibrary/localoperationsdk/1.0.0/localoperationsdk-1.0.0.pom
- example/node_modules/jsc-android/dist/com/mylibrary/localoperationsdk/1.0.0/localoperationsdk-1.0.0.pom
- https://dl.google.com/dl/android/maven2/com/mylibrary/localoperationsdk/1.0.0/localoperationsdk-1.0.0.pom
- https://www.jitpack.io/com/mylibrary/localoperationsdk/1.0.0/localoperationsdk-1.0.0.pom
Required by:
The error indicates that it is not looking in the right places to resolve the package. It looks on the online repositories and inside the node_modules/jsc-android/dist/com/mylibrary/localoperationsdk
What do I need to change to make sure that it is looking in the right place?