仅适用于使用 Gradle 7 或更早版本的情况:在顶级settings.gradle.kts 文件中包含 mavenCentral:
allprojects {
repositories {
<span class="hljs-built_in">mavenCentral</span>()
}
}
如果您使用的 Gradle 版本高于 7,请跳过步骤 1 并继续执行步骤 2。
将以下行添加到应用程序模块的 dependencies 元素中build.gradle。
dependencies {
implementation <span class="hljs-string">'com.inmobi.monetization:inmobi-ads-kotlin:11.4.0'</span>
}
或者,您可以下载最新版本的InMobi Kotlin SDK,并将库复制到您的应用程序模块的libs/directory 目录中。
除了支持门户中提到的依赖项之外,请将以下依赖项添加到您的模块“build.gradle”中,以便集成 inmobi-ads-kotlin。
implementation <span class="hljs-string">'androidx.core:core-ktx:1.5.0'</span>
implementation <span class="hljs-string">'com.inmobi.omsdk:inmobi-omsdk:1.5.7.0'</span>
By installing this SDK update, you agree that your Children Privacy Compliance setting remains accurate or that you will update that setting, whenever there is a change in your app's audience. You may update the app's Children Privacy Compliance settings at https://publisher.inmobi.com/my-inventory/app-and-placements.
Support Center