2

I am building a react-native project but not able to add an aar file as a dependency.

I have followed following steps

  1. Created libs folder and placed aar file in that.
  2. Written this in top level Gradle

     repositories {
       mavenCentral()
       flatDir {
         dirs 'libs'
       }
    }
    
  3. added following line to dependencies

    compile project(name: "xyz", ext: 'aar')
    

And I am facing this error while building

* What went wrong:
A problem occurred evaluating project ':react-native-abc'.
> Required keys [path] are missing from map {name=xyz, ext=aar}.
Hari Ram
  • 3,098
  • 5
  • 23
  • 30

1 Answers1

0

-> In Step 2, just make sure that while adding

    flatDir{ 
       dirs 'libs' 
    }

in repositories , repository belongs to allprojects instead of buildscript.

-> In step 3 try this :

    compile(name: "xyz",ext: 'aar')
Robin
  • 1
  • 1