Adding Mopub SDK results in "finished with non-zero exit value 1"


#1

I’m having trouble adding the mopub sdk. I’ve tried this about a million different ways. Each time I get an error when I try to build the project.

This is my app module’s build.gradle:

apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'
// Uncomment when using CrashlyticsComponent
//apply plugin: 'io.fabric'
apply from: "../artifacts.gradle"

repositories {
    // Uncomment when using CrashlyticsComponent
    //maven { url 'https://maven.fabric.io/public' }
    jcenter()
    maven { url "https://s3.amazonaws.com/moat-sdk-builds"}

    maven {
        url 'https://maven.google.com/'
        name 'Google'
    }
}



buildscript {
    repositories {
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        jcenter()
        maven { url 'https://maven.fabric.io/public' }

    }
    dependencies {
        classpath 'me.tatarka:gradle-retrolambda:3.2.3'
        // Uncomment when using CrashlyticsComponent
        //classpath 'io.fabric.tools:gradle:1.+'
    }
}

android {
    compileSdkVersion 23
    buildToolsVersion "25.0.0"
    defaultConfig {
        applicationId "com.litttv.android.lifegenius"
        minSdkVersion 21
        targetSdkVersion 23
        versionCode 17
        versionName "2.0.1"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            testCoverageEnabled = true
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    // this is for jackson
    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/services/com.fasterxml.jackson.core.JsonFactory'
        exclude 'META-INF/services/com.fasterxml.jackson.core.ObjectCodec'
        exclude 'META-INF/rxjava.properties'
    }

    lintOptions {
        abortOnError false
    }

}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile 'junit:junit:4.12'
    androidTestCompile 'org.mockito:mockito-core:1.9.5'
    androidTestCompile('com.android.support.test:rules:0.5') {
        exclude group: 'com.android.support', module: 'support-annotations'
    }
    androidTestCompile('com.android.support.test:runner:0.5') {
        exclude group: 'com.android.support', module: 'support-annotations'
    }
    androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
    androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
    androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.3.1'
    compile project(':TVUIComponent')
    compile project(':UAMP')
    compile project(':AMZNMediaPlayerComponent')
    compile project(':VastAdsComponent')
    compile project(':PassThroughLoginComponent')
    compile project(':LoggerAnalyticsComponent')
    compile 'com.google.android.gms:play-services:8.1.0'
    compile 'com.facebook.android:audience-network-sdk:5.0.0'
    compile 'com.google.ads.mediation:mopub:4.12.0.0'
    compile('com.mopub:mopub-sdk:5.3.0@aar') {
        transitive = true
    }
}

This is the build.gradle for the application:

buildscript {
    repositories {
        mavenCentral()
        jcenter()
    }

    dependencies {
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
        classpath 'com.android.tools.build:gradle:2.2.3'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        mavenCentral()
        if (rootProject.hasProperty('mavenUrl')) {
            maven { url rootProject.mavenUrl }
        }
    }
}

My settings.gradle file:

include ':app',
        /* Frameworks */
        ':TVUIComponent',
        ':UAMP',
        /* Libraries */
        ':Calligraphy',
        ':ContentModel',
        ':ContentBrowser',
        ':DynamicParser',
        ':DataLoader',
        ':Utils',
        // Uncomment when using ComScore Analytics
        //':comscore',
        /* Interfaces */
        ':PurchaseInterface',
        ':AuthInterface',
        ':AdsInterface',
        ':AnalyticsInterface',
        ':ModuleInterface',
        /* Implementations */
        ':mopub-sdk',
        ':VastAdsComponent',
        ':AMZNMediaPlayerComponent',
        ':PassThroughLoginComponent',
        ':LoggerAnalyticsComponent'

/* Frameworks */
project(':TVUIComponent').projectDir = new File(rootProject.projectDir, '../TVUIComponent/lib')
project(':UAMP').projectDir = new File(rootProject.projectDir, '../UAMP')

/* Libraries */
project(':Calligraphy').projectDir = new File(rootProject.projectDir, '../TVUIComponent/Calligraphy')
project(':ContentModel').projectDir = new File(rootProject.projectDir, '../ContentModel')
project(':ContentBrowser').projectDir = new File(rootProject.projectDir, '../ContentBrowser')
project(':DynamicParser').projectDir = new File(rootProject.projectDir, '../DynamicParser')
project(':DataLoader').projectDir = new File(rootProject.projectDir, '../DataLoader')
project(':Utils').projectDir = new File(rootProject.projectDir, '../Utils')

/* Interfaces */
project(':ModuleInterface').projectDir = new File(rootProject.projectDir, '../ModuleInterface')
project(':AdsInterface').projectDir = new File(rootProject.projectDir, '../AdsInterface')
project(':AuthInterface').projectDir = new File(rootProject.projectDir, '../AuthInterface')
project(':AnalyticsInterface').projectDir = new File(rootProject.projectDir, '../AnalyticsInterface')
project(':PurchaseInterface').projectDir = new File(rootProject.projectDir, '../PurchaseInterface')

/* Implementations */
project(':mopub-sdk').projectDir = new File(rootProject.projectDir, '../mopub-sdk')
project(':AMZNMediaPlayerComponent').projectDir = new File(rootProject.projectDir, '../AMZNMediaPlayerComponent')
project(':VastAdsComponent').projectDir = new File(rootProject.projectDir, '../VastAdsComponent')
project(':PassThroughLoginComponent').projectDir = new File(rootProject.projectDir, '../PassThroughLoginComponent')

I’ve been stuck on this for quite some time now. I would appreciate any assistance in getting the mopub-sdk up and running. Thanks so much!


#2

@LifeGenius

I’m sure you’ve read through our integration documentation (see below), but if not I would encourage you to review.

Android: https://developers.mopub.com/docs/android/getting-started/
iOS: https://developers.mopub.com/docs/ios/getting-started/

Our sample app is a good reference to check your code agaisnt. It represents a clean and working MoPub integration.

If you continue to have issues, please contact us at support@mopub.com and we’re happy to dig in deeper with you.