Search code examples
androidgradlebuild.gradleyandex

Could not find com.appnext.sdk:ads:2.7.1.473


To test Yandex Ad SDK I created a new project in Android Studio

And according to their docs I added the following repositories to settings.gradle:

maven { url "https://android-sdk.is.com/" }
maven { url "https://artifact.bytedance.com/repository/pangle" }
maven { url "https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea"}
maven { url "https://sdk.tapjoy.com/"}

so settings.gradle content is:

pluginManagement {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()

        maven { url "https://android-sdk.is.com/" }
        maven { url "https://artifact.bytedance.com/repository/pangle" }
        maven { url "https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea"}
        maven { url "https://sdk.tapjoy.com/"}
    }
}
rootProject.name = "My Application"
include ':app'

and added

implementation 'com.yandex.android:mobileads-mediation:6.3.0.0'

to build.gradle:

plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
}

android {
    namespace 'com.example.myapplication'
    compileSdk 33

    defaultConfig {
        applicationId "com.example.myapplication"
        minSdk 24
        targetSdk 33
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
    buildFeatures {
        viewBinding true
    }
}

dependencies {

    implementation 'androidx.core:core-ktx:1.8.0'
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'com.google.android.material:material:1.5.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3'
    implementation 'androidx.navigation:navigation-ui-ktx:2.5.3'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

    implementation 'com.yandex.android:mobileads-mediation:6.3.0.0'
}

And when I tried to build the project in Android Studio I got the following errors:

FAILURE: Build completed with 9 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:dataBindingMergeDependencyArtifactsDebug'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
  > Could not find com.appnext.sdk:ads:2.7.1.473.
    Searched in the following locations:
      - https://dl.google.com/dl/android/maven2/com/appnext/sdk/ads/2.7.1.473/ads-2.7.1.473.pom
      - https://repo.maven.apache.org/maven2/com/appnext/sdk/ads/2.7.1.473/ads-2.7.1.473.pom
      - https://android-sdk.is.com/com/appnext/sdk/ads/2.7.1.473/ads-2.7.1.473.pom
      - https://artifact.bytedance.com/repository/pangle/com/appnext/sdk/ads/2.7.1.473/ads-2.7.1.473.pom
      - https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea/com/appnext/sdk/ads/2.7.1.473/ads-2.7.1.473.pom
      - https://sdk.tapjoy.com/com/appnext/sdk/ads/2.7.1.473/ads-2.7.1.473.pom
    Required by:
        project :app > com.yandex.android:mobileads-mediation:6.3.0.0 > com.yandex.ads.mediation:mobileads-appnext:2.7.1.473.0
  > Could not find com.appnext.sdk:banners:2.7.1.473.
    Searched in the following locations:
      - https://dl.google.com/dl/android/maven2/com/appnext/sdk/banners/2.7.1.473/banners-2.7.1.473.pom
      - https://repo.maven.apache.org/maven2/com/appnext/sdk/banners/2.7.1.473/banners-2.7.1.473.pom
      - https://android-sdk.is.com/com/appnext/sdk/banners/2.7.1.473/banners-2.7.1.473.pom
      - https://artifact.bytedance.com/repository/pangle/com/appnext/sdk/banners/2.7.1.473/banners-2.7.1.473.pom
      - https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea/com/appnext/sdk/banners/2.7.1.473/banners-2.7.1.473.pom
      - https://sdk.tapjoy.com/com/appnext/sdk/banners/2.7.1.473/banners-2.7.1.473.pom
    Required by:
        project :app > com.yandex.android:mobileads-mediation:6.3.0.0 > com.yandex.ads.mediation:mobileads-appnext:2.7.1.473.0
  > Could not find com.appnext.sdk:native-ads2:2.7.1.473.
    Searched in the following locations:
      - https://dl.google.com/dl/android/maven2/com/appnext/sdk/native-ads2/2.7.1.473/native-ads2-2.7.1.473.pom
      - https://repo.maven.apache.org/maven2/com/appnext/sdk/native-ads2/2.7.1.473/native-ads2-2.7.1.473.pom
      - https://android-sdk.is.com/com/appnext/sdk/native-ads2/2.7.1.473/native-ads2-2.7.1.473.pom
      - https://artifact.bytedance.com/repository/pangle/com/appnext/sdk/native-ads2/2.7.1.473/native-ads2-2.7.1.473.pom
      - https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea/com/appnext/sdk/native-ads2/2.7.1.473/native-ads2-2.7.1.473.pom
      - https://sdk.tapjoy.com/com/appnext/sdk/native-ads2/2.7.1.473/native-ads2-2.7.1.473.pom
    Required by:
        project :app > com.yandex.android:mobileads-mediation:6.3.0.0 > com.yandex.ads.mediation:mobileads-appnext:2.7.1.473.0
  > Could not find com.chartboost:chartboost-sdk:9.3.1.
    Searched in the following locations:
      - https://dl.google.com/dl/android/maven2/com/chartboost/chartboost-sdk/9.3.1/chartboost-sdk-9.3.1.pom
      - https://repo.maven.apache.org/maven2/com/chartboost/chartboost-sdk/9.3.1/chartboost-sdk-9.3.1.pom
      - https://android-sdk.is.com/com/chartboost/chartboost-sdk/9.3.1/chartboost-sdk-9.3.1.pom
      - https://artifact.bytedance.com/repository/pangle/com/chartboost/chartboost-sdk/9.3.1/chartboost-sdk-9.3.1.pom
      - https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea/com/chartboost/chartboost-sdk/9.3.1/chartboost-sdk-9.3.1.pom
      - https://sdk.tapjoy.com/com/chartboost/chartboost-sdk/9.3.1/chartboost-sdk-9.3.1.pom

...
BUILD FAILED in 31s
21 actionable tasks: 9 executed, 12 up-to-date

What do these errors mean? What can be wrong? Is it possible to fix them?

I tried to consult with their support, but they did not help.


Solution

  • According to the documentation, since you are integrating the mediation of Yandex, you need to remove all the urls you added in settings.gradle and add them in the build.gradle file of your project module. It is step 2.4 in their integration document.

    Add the following code to the build.gradle file in your app's module:
    
    // IronSource
    maven {
           url 'https://android-sdk.is.com/'
    }
    
    // Pangle
    maven {
           url 'https://artifact.bytedance.com/repository/pangle'
    }
    
    // Tapjoy
    maven {
           url "https://sdk.tapjoy.com/"
    }
    
    // Mintegral
    maven {
           url "https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea"
    }
    
    // Chartboost
    maven {
           url "https://cboost.jfrog.io/artifactory/chartboost-ads/"
    }
    
    // AppNext
    maven {
          url "https://dl.appnext.com/"
    }
    

    They also state there that:

    For each adapter, the latest compatible version is selected automatically.