title: Mopub Android Setup: 'Could not find moat-mobile-app-kit'
body: <h1>Expected</h1>
  
  <p>Building the Android <em>mopub</em> library successfully with the configuration outlined in the <a href="https://developers.mopub.com/docs/android/getting-started/" rel="nofollow noreferrer">Getting Started</a> documentation under the <a href="https://developers.mopub.com/docs/android/getting-started/" rel="nofollow noreferrer">jcenter</a> implementation.</p>
  
  <h2>Setup</h2>
  
  <p><em>build.gradle (project)</em></p>
  
  <p>Included the <strong>jcenter</strong> and <strong>moat-sdk-builds</strong> libraries.</p>
  
  <pre><code>buildscript {
      ext.kotlin_version = '1.3.11'
      repositories {
          google()
          jcenter()
          mavenCentral()
          maven { url 'https://maven.google.com' }
          maven { url "https://s3.amazonaws.com/moat-sdk-builds" }
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:3.2.1'
          classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
          classpath 'com.google.gms:google-services:4.2.0'
          classpath "android.arch.navigation:navigation-safe-args-gradle-plugin:1.0.0-alpha09"
      }
  }
  
  allprojects {
      repositories {
          google()
          jcenter()
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  } 
  </code></pre>
  
  <p><em>build.gralde (app)</em></p>
  
  <p>Included the library <strong>mopub-sdk:5.4.1@aar</strong>.</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  apply plugin: 'kotlin-android'
  
  apply plugin: 'kotlin-android-extensions'
  
  apply plugin: "androidx.navigation.safeargs"
  
  apply plugin: 'kotlin-kapt'
  
  apply plugin: 'com.google.gms.google-services'
  
  android {
      compileSdkVersion 28
      defaultConfig {
          applicationId "app.coinverse"
          minSdkVersion 27
          targetSdkVersion 28
          versionCode 15
          versionName "0.15"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
          javaCompileOptions {
              annotationProcessorOptions {
                  arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
              }
          }
      }
      sourceSets {
          androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
      }
      buildTypes {
          release {
              shrinkResources true
              minifyEnabled true
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
          debug {
              applicationIdSuffix ".staging"
              debuggable true
          }
      }
      compileOptions {
          targetCompatibility JavaVersion.VERSION_1_8
      }
  
      dataBinding.enabled = true
  }
  
  dependencies {
      def lifecycle_version = "2.0.0"
      def paging_version = "2.0.0"
      def nav_version = "1.0.0-alpha09"
      def nav_testing_version = "1.0.0-alpha08"
      def room_version = "2.0.0"
  
      implementation fileTree(dir: 'libs', include: ['*.jar'])
      implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
      implementation 'androidx.appcompat:appcompat:1.0.2'
      implementation 'androidx.legacy:legacy-support-v4:1.0.0'
      implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
      implementation 'androidx.cardview:cardview:1.0.0'
      implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
      kapt "androidx.lifecycle:lifecycle-compiler:$lifecycle_version"
      implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
      implementation "androidx.lifecycle:lifecycle-reactivestreams-ktx:$lifecycle_version"
      implementation "androidx.paging:paging-runtime:$paging_version"
      implementation "androidx.paging:paging-rxjava2:$paging_version"
      implementation 'com.google.android.gms:play-services-auth:16.0.1'
      implementation 'com.firebase:firebase-client-android:2.5.2'
      implementation 'com.google.firebase:firebase-core:16.0.6'
      implementation 'com.google.firebase:firebase-firestore:17.1.5'
      implementation 'com.google.firebase:firebase-functions:16.1.3'
      implementation 'com.google.firebase:firebase-auth:16.1.0'
      implementation 'com.firebaseui:firebase-ui-firestore:4.2.0'
      implementation 'com.firebaseui:firebase-ui-auth:4.2.1'
      implementation 'com.google.firebase:firebase-storage:16.0.5'
      implementation 'com.google.firebase:firebase-inappmessaging-display:17.0.4'
      implementation 'com.google.firebase:firebase-config:16.1.2'
      implementation 'com.jjoe64:graphview:4.2.2'
      implementation 'com.google.android.exoplayer:exoplayer-core:2.9.2'
      implementation 'com.google.android.exoplayer:exoplayer-ui:2.9.2'
      implementation files('libs/YouTubeAndroidPlayerApi.jar')
      implementation 'io.reactivex.rxjava2:rxjava:2.2.4'
      implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
      implementation "android.arch.navigation:navigation-fragment-ktx:$nav_version"
      implementation "android.arch.navigation:navigation-ui-ktx:$nav_version"
      implementation "androidx.room:room-runtime:$room_version"
      kapt "androidx.room:room-compiler:$room_version"
      implementation "androidx.room:room-rxjava2:$room_version"
      implementation "androidx.room:room-guava:$room_version"
      implementation 'com.github.bumptech.glide:glide:4.8.0'
      kapt 'com.github.bumptech.glide:compiler:4.8.0'
      implementation('com.mopub:mopub-sdk:5.4.1@aar') {
          transitive = true
      }
  
      // Testing
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'androidx.test:runner:1.1.1'
      androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
      testImplementation "androidx.arch.core:core-testing:$lifecycle_version"
      androidTestImplementation "android.arch.navigation:navigation-testing:$nav_testing_version"
      testImplementation "androidx.room:room-testing:$room_version"
      testImplementation "android.arch.persistence.room:testing:$room_version"
  }
  </code></pre>
  
  <h1>Result</h1>
  
  <h2>The result is the following error when building</h2>
  
  <blockquote>
    <p>Could not find com.moat.analytics.mobile.mpub:moat-mobile-app-kit:2.4.5.</p>
    
    <p>Searched in the following locations:
        file:/Users/adamhurwitz/Library/Android/sdk/extras/m2repository/com/moat/analytics/mobile/mpub/moat-mobile-app-kit/2.4.5/moat-mobile-app-kit-2.4.5.pom
        file:/Users/adamhurwitz/Library/Android/sdk/extras/m2repository/com/moat/analytics/mobile/mpub/moat-mobile-app-kit/2.4.5/moat-mobile-app-kit-2.4.5.jar
        file:/Users/adamhurwitz/Library/Android/sdk/extras/google/m2repository/com/moat/analytics/mobile/mpub/moat-mobile-app-kit/2.4.5/moat-mobile-app-kit-2.4.5.pom
        file:/Users/adamhurwitz/Library/Android/sdk/extras/google/m2repository/com/moat/analytics/mobile/mpub/moat-mobile-app-kit/2.4.5/moat-mobile-app-kit-2.4.5.jar
        file:/Users/adamhurwitz/Library/Android/sdk/extras/android/m2repository/com/moat/analytics/mobile/mpub/moat-mobile-app-kit/2.4.5/moat-mobile-app-kit-2.4.5.pom
        file:/Users/adamhurwitz/Library/Android/sdk/extras/android/m2repository/com/moat/analytics/mobile/mpub/moat-mobile-app-kit/2.4.5/moat-mobile-app-kit-2.4.5.jar
        <a href="https://dl.google.com/dl/android/maven2/com/moat/analytics/mobile/mpub/moat-mobile-app-kit/2.4.5/moat-mobile-app-kit-2.4.5.pom" rel="nofollow noreferrer">https://dl.google.com/dl/android/maven2/com/moat/analytics/mobile/mpub/moat-mobile-app-kit/2.4.5/moat-mobile-app-kit-2.4.5.pom</a>
        <a href="https://dl.google.com/dl/android/maven2/com/moat/analytics/mobile/mpub/moat-mobile-app-kit/2.4.5/moat-mobile-app-kit-2.4.5.jar" rel="nofollow noreferrer">https://dl.google.com/dl/android/maven2/com/moat/analytics/mobile/mpub/moat-mobile-app-kit/2.4.5/moat-mobile-app-kit-2.4.5.jar</a>
        <a href="https://jcenter.bintray.com/com/moat/analytics/mobile/mpub/moat-mobile-app-kit/2.4.5/moat-mobile-app-kit-2.4.5.pom" rel="nofollow noreferrer">https://jcenter.bintray.com/com/moat/analytics/mobile/mpub/moat-mobile-app-kit/2.4.5/moat-mobile-app-kit-2.4.5.pom</a>
        <a href="https://jcenter.bintray.com/com/moat/analytics/mobile/mpub/moat-mobile-app-kit/2.4.5/moat-mobile-app-kit-2.4.5.jar" rel="nofollow noreferrer">https://jcenter.bintray.com/com/moat/analytics/mobile/mpub/moat-mobile-app-kit/2.4.5/moat-mobile-app-kit-2.4.5.jar</a> </p>
  </blockquote>
  
  <h2>Attempted Solution</h2>
  
  <p>When <code>transitive = true</code> is commented out in Gradle the app builds, runs, and the <em>mopub</em> library is present under the external libraries section.</p>
  
  <p><strong>Does <code>transitive = true</code>need to be enabled? If so, how can I resolve the <em>Could not find com.moat.analytics.mobile.mpub:moat-mobile-app-kit</em> error?</strong> </p>
  
  <pre><code>implementation('com.mopub:mopub-sdk:5.4.1@aar') {
      //transitive = true
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/7eLw0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7eLw0.png" alt="enter image description here"></a></p>