1.1 Android Studio配置
<h1>1.1.1 接入方式</h1>
<h3>第一步:添加FqGameSdk_vx.x.x.aar到项目libs目录下,如图</h3>
<p><img src="https://www.showdoc.com.cn/server/api/attachment/visitfile/sign/89cbb1edd479ff0afbbbfa446fa2e27a" alt="" /></p>
<h3>第二步:在<font color=red>项目build.gradle</font>中添加相关配置,如下:</h3>
<pre><code>buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
classpath 'com.google.gms:google-services:4.3.4'
//接入华为SDK,增加agcp配置。
classpath 'com.huawei.agconnect:agcp:1.6.3.300'
}
}
allprojects {
repositories {
jcenter()
google()
mavenCentral()
// 配置HMS Core SDK的Maven仓地址。
maven {url 'https://developer.huawei.com/repo/'}
//Anythink(Core)
maven {url "https://anythink.jfrog.io/artifactory/android_sdk"}
//Vungle
maven {url "https://s01.oss.sonatype.org/content/groups/staging/"}
//Mintegral
maven {url "https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea"}
}
}</code></pre>
<p><font color=red>注:com.google.gms:google-services:4.3.4必须添加</font></p>
<h3>在<font color=red>app项目build.gradle</font>最后添加</h3>
<pre><code>apply plugin: 'com.google.gms.google-services'
//接入华为HMS Core SDK需配置
apply plugin: 'com.huawei.agconnect'</code></pre>
<h3>第三步:在<font color=red>app/build.gradle</font>添加内容:</h3>
<h4>在android中添加:</h4>
<pre><code>compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}</code></pre>
<h4>dependencies中添加相关依赖</h4>
<pre><code> implementation 'com.android.support:multidex:1.0.3'
implementation 'com.facebook.android:facebook-android-sdk:11.3.0'
implementation 'com.google.firebase:firebase-ads:19.2.0'
implementation 'com.facebook.android:audience-network-sdk:6.8.0'
implementation 'androidx.recyclerview:recyclerview:1.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.android.support:support-annotations:22.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.gms:play-services-auth:19.0.0'
implementation "com.android.billingclient:billing:3.0.3"
implementation 'com.android.installreferrer:installreferrer:2.2'
implementation 'com.linecorp:linesdk:5.0.1'
//凤起sdk
implementation files('libs/fqgamesdklib-1.x.x.x.aar')
//华为分析
implementation 'com.huawei.hms:hianalytics:6.3.0.300'
//TopOn Sdk(以下皆为TopOn聚合所需)
implementation "com.anythink.sdk:core:5.9.80"
implementation "com.anythink.sdk:rewardedvideo:5.9.80"
//StartApp
implementation "com.anythink.sdk:adapter-startapp:5.9.80"
implementation "com.startapp:inapp-sdk:4.9.2"
//Vungle
implementation "com.anythink.sdk:adapter-vungle:5.9.80"
implementation "com.vungle:publisher-sdk-android:6.11.0"
implementation "androidx.core:core:1.3.2"
implementation "androidx.localbroadcastmanager:localbroadcastmanager:1.0.0"
//UnityAds
implementation "com.anythink.sdk:adapter-unityads:5.9.80"
implementation "com.unity3d.ads:unity-ads:4.2.1"
//AdColony
implementation "com.anythink.sdk:adapter-adcolony:5.9.80"
implementation "com.adcolony:sdk:4.6.5"
//Huawei
implementation "com.anythink.sdk:adapter-huawei-nonchina:5.9.80.1"
implementation "com.huawei.hms:ads:3.4.54.300"
//Mintegral
implementation "com.anythink.sdk:adapter-mintegral-nonchina:5.9.80.1"
implementation "com.mbridge.msdk.oversea:reward:16.1.71"
implementation "com.mbridge.msdk.oversea:mbbid:16.1.71"
</code></pre>
<h3>将运营人员提供的华为agconnect-services.json文件放置在项目的应用级根目录下</h3>
<p>示例:
<img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=8212682cb339410c9020a539a502917a&file=file.gif" alt="" /></p>
<h3><font color=red>注意:工程相应版本设置如下图,如添加后编译报错,请按图上中设置修改</font></h3>
<pre><code>minSdkVersion = 21
targetSdkVersion = 29
compileSdkVersion = 28
buildToolsVersion = '28.0.2'</code></pre>
<h3><font color=red>如果有必要请修改gradle.properties 文件</font></h3>
<pre><code>android.useAndroidX=true
android.enableJetifier=true</code></pre>