androidfacebook-audience-networkapplovin

AppLovin Quality Service Gradle Plugin


I'm trying to mediate my app with MAX and I'm having trouble trying to integrating it on my Gradle file I have followed all the instructions here but I keep the error log below every time I try to build my app :

    A problem occurred configuring project ':app'.
> Could not resolve all artifacts for configuration ':app:classpath'.
   > Could not find com.applovin.quality:AppLovinQualityServiceGradlePlugin:.
     Required by:
         project :app

My Gradle file :

    // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        mavenCentral()
        maven { url 'https://artifacts.applovin.com/android' }

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.2.2'
        classpath 'com.google.gms:google-services:4.3.10'
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

My Gradle App level :

    buildscript {
    repositories {
        google()
        maven { url 'https://plugins.gradle.org/m2/' }
    }
    dependencies {
        classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.12.7'
        classpath "com.applovin.quality:AppLovinQualityServiceGradlePlugin:"

    }

}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'applovin-quality-service'

applovin {
    apiKey "########JW3nelTryi1TlKCldNWG-wtTZGhEz_Tpu-ByT6bsZccJT4rABgGP9HNBQqcmywT7_rMvrl0zQvn"
}

android {
    compileSdkVersion 31
    defaultConfig {
        applicationId "com.wallpapers_8k_Sad.app"
        minSdkVersion 19
        targetSdkVersion 31
        versionCode 8
        multiDexEnabled true
        versionName "1.08"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }


    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'androidx.appcompat:appcompat:1.4.1'
    compile 'com.facebook.android:audience-network-sdk:6.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
    implementation 'com.google.firebase:firebase-database:20.0.4'
    testImplementation 'junit:junit:4.13'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    implementation 'com.google.android.material:material:1.5.0'
    implementation 'com.google.ads.mediation:facebook:6.8.0.0'
    implementation 'com.google.android.gms:play-services-ads:20.6.0'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.applovin:applovin-sdk:+'
    implementation 'com.onesignal:OneSignal:4.3.0'
}

My manifest meta line :

<meta-data android:name="applovin.sdk.key"
        android:value="######oRQNDu54FZ1Sr7DocsC0hcs-3ZD91eX-OXTxFK75Qg_EANzzxoKr9lxTdgIh3c-G5os5ykNx2gz4Q5x"/>

N/B - The hashtags added are just added manually to hide my keys.


Solution

  • Found out I needed to add the applovin dependency inside the gradle top level build file adding the specific version as well

        // Top-level build file where you can add configuration options common to all sub-projects/modules.
    
    buildscript {
        repositories {
            google()
            mavenCentral()
            maven { url 'https://artifacts.applovin.com/android' }
    
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:4.2.2'
            classpath 'com.google.gms:google-services:4.3.10'
            classpath "com.applovin.quality:AppLovinQualityServiceGradlePlugin:4.3.7"
    
        }
    }
    
    allprojects {
        repositories {
            google()
            mavenCentral()
    
        }
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }