I am building an android React Native module and my code imports classes from a 3rd party SDK which is provided as an aar file. How should I bundle this file into my module? I tried adding
allprojects {
repositories {
flatDir {
dirs: 'libs'
}
}
}
and
dependencies {
... other deps ...
compile (name:'my-external-lib', ext:'aar')
}
to the build.gradle file and putting this my-external-lib.aar file into libs/
folder, but still getting an error when building MyApp react-native application with react-native-my-module included:
* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration
':app:_developmentDebugApkCopy'.
> Could not find :my-external-lib:.
Required by:
MyApp:app:unspecified > MyApp:react-native-my-module:unspecified
Any advice?