/ android

#IronSource# 接入Admob、Facebook报错:Failed to resolve: com.ironsource.adapters

问题背景

Android 平台接入IronSource广告聚合时,按照文档一步步接入,但是在编译的时候却报错:

CONFIGURE SUCCESSFUL in 0s
ERROR: Failed to resolve: com.ironsource.adapters:admobadapter:4.3.14
Show in Project Structure dialog
Affected Modules: app

ERROR: Failed to resolve: com.ironsource.adapters:facebookadapter:4.3.21
Show in Project Structure dialog
Affected Modules: app

IronSource-adapter-failed

奇怪的是,相同网络条件下,IronSource的另一个依赖库com.ironsource.sdk:mediationsdk却没有报错。

无论怎么设置Http Proxy代理服务器,都无法解决改问题。

解决方法

最后发现,需要在app的gradle添加对应的repositories,如下

repositories {
    jcenter()
    google()
    maven {
        url "https://dl.bintray.com/ironsource-mobile/android-sdk"
    }
    maven {
        url 'https://dl.bintray.com/ironsource-mobile/android-adapters'
    }
}

像这样子:
IronSource-adapter-gradle-repo