Replacing JCenter() with mavenCentral() causes error in webrtc

Viewed 1873

Could not find org.webrtc:google-webrtc:1.0.32006. Required by: project :app

1 Answers

Although I tend to agree re-adding jcenter repo, due to that annoying lint warning using deprecated repo I'd like to suggest a different solution.

  1. Go to jcenter and download the aar/jar file of dependency org.webrtc:google-webrtc:1.0.32006.
  2. Check the pom file if inner dependencies are needed and add them to project (normally if they exist in maven central, manually download aar/jar otherwise).
  3. Copy aar/jar of your dependency (and inner dependencies, if needed) it to your project's libs folder.
  4. Add dependency to all files in libs folder.

I'll update this answer with code samples as soon as I'm able.

EDIT:

Download AAR file from the following link and save it in libs folder: http://estigia.lsi.us.es:1681/artifactory/libs-release/org/webrtc/google-webrtc/1.0.32006/

Add this dependency to compile all files in libs folder:

implementation fileTree(dir: "libs", include: ["*.aar"])

I don't see any inner dependencies in the POM file so I think it should work.

EDIT #2:

It appears that they deliberately removed this option because of all sort of errors.

In the JetBrains ticket's comment they offer to create a local maven repo and use it:

Discussed with the Android Studio team. This option was deliberately removed, because of technical problems it introduces which often results in broken packages. Proper way to have local AAR dependency is local maven repository. E.g.

allprojects {
    repositories {
        maven {
            url "file://${projectDir}/repo"
        }
    }
}

I'm guessing you only need to copy all of the artifacts from good old jcenter with the original file structure and naming convention.

Related