2

I build an android webrtc app but when adding webrtc to the android studio project (implementation 'org.webrtc:google-webrtc:1.0.+'), I get this error : Failed to resolve: org.webrtc:google-webrtc

How to add webrtc to an android app ?

vincent13123
  • 23
  • 1
  • 5

7 Answers7

4

Currently it seems we are forced to keep jcenter, a deprecated repository, to install this package. Jcenter remain readonly and is not removed for now.

For production you could considere making your own build.

// root build.gradle
allprojects {
    repositories {
        jcenter()

you can check this issue from twillio

Pierre Noyelle
  • 478
  • 3
  • 8
  • 2
    note that the package itself has been deprecated and not received security fixes (with one exception) since early https://groups.google.com/g/discuss-webrtc/c/Ozvbd0p7Q1Y/m/M4WN2cRKCwAJ? – Philipp Hancke May 04 '22 at 09:51
2

//In the settings.gradle file

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
    google()
    mavenCentral()
    //add jcenter()
    jcenter()
}

}

anville95
  • 21
  • 5
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 18 '22 at 09:31
1

//Android => App => build.gradle

repositories {
    jcenter()
}

dependencies {
    
}
ixhimanshu
  • 77
  • 5
0

Just take the step:

     implementation 'org.webrtc:google-webrtc:1.0+'

and Replace in code:

     implementation 'org.webrtc:google-webrtc:1.0.32006'

☻♥ Done Keep Code

0

I got issue like.

enter image description here

After of 4 hours struggle I Got the Solution :

Apply dependency changes like below.

from this : `

implementation 'org.webrtc:google-webrtc:1.0.+'

`

to This : `

implementation 'org.webrtc:google-webrtc:1.0.32006'

` ☻♥ Done Keep Code.

0
allprojects {
        repositories {
            ..
            maven { url "https://raw.githubusercontent.com/alexgreench/google-webrtc/master" }
        }
 }

 dependencies {
     ..
     implementation 'org.webrtc:google-webrtc:1.0.30039@aar'
 }

Temporary solution :)

-1

Try it with on maven central. I think this is the latest build based on the published date.

https://mvnrepository.com/artifact/org.webrtc/google-webrtc/1.0.32006

In app build.gradle:

implementation 'org.webrtc:google-webrtc:1.0.32006'

In project build.gradle:

repositories {
    google()
    mavenCentral()
}
abalta
  • 1,204
  • 1
  • 12
  • 21