0

I'm trying to use MoPub using AdMob mediation. I've followed all instructions at https://developers.google.com/admob/android/mediation/mopub.

Currently I use facebook, applovin, inmobi through admob mediation and all of them work well. I integrated MoPub several times but it always says manifest not found. The problem is in step 3 https://developers.google.com/admob/android/mediation/mopub#step_3_import_the_mopub_sdk_and_adapter.

Note: I'm using androidX.

when testing I see this. I used admob mediation test suite and found like this. IT SAYS MANIFEST NOT FOUND

Here is my app-level build.gradle

 apply plugin: 'com.android.application'
 apply plugin: 'com.google.gms.google-services'


  android {

compileSdkVersion 30
buildToolsVersion '30.0.1'
defaultConfig {
    applicationId 'com.theaccidentalmedico.sociology'
    minSdkVersion 21
    targetSdkVersion 30
    versionCode 1
    versionName "1.0.0"
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
    debug {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    release {
        shrinkResources true
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

    }
}
lintOptions {
    disable 'MissingTranslation'
}
productFlavors {
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
}
  repositories {
        google()
        jcenter()
         maven {
        url "https://s3.amazonaws.com/moat-sdk-builds"}
        }
   dependencies {
  implementation fileTree(include: ['*.jar'], dir: 'libs')

androidTestImplementation('androidx.test.espresso:espresso-core:3.2.0', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.google.firebase:firebase-analytics:17.4.4'
implementation 'com.google.android.gms:play-services-ads:19.2.0'
implementation 'com.google.ads.mediation:facebook:5.9.0.0'
implementation 'com.google.ads.mediation:mopub:5.13.1.0'
implementation 'com.codemybrainsout.rating:ratingdialog:1.0.8'
implementation 'com.google.ads.mediation:applovin:9.13.0.0'
implementation 'com.google.android.ads:mediation-test-suite:1.3.0'

implementation 'androidx.appcompat:appcompat:1.1.0'

implementation 'com.google.android.material:material:1.1.0'

testImplementation 'junit:junit:4.13'
   }

Here is my project level build.gradle.

buildscript {
repositories {
    google()
    jcenter()

 }
dependencies {
    classpath 'com.android.tools.build:gradle:3.6.4'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
    classpath 'com.google.gms:google-services:4.3.3'
}
      }

      allprojects {
repositories {
    google()
    jcenter()
   
   }
     }

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

I'm using AndroidX. Here is my gradle.properties file

 # Project-wide Gradle settings.

 # IDE (e.g. Android Studio) users:
 # Gradle settings configured through the IDE *will override*
 # any settings specified in this file.

 # For more details on how to configure your build environment visit
 # http://www.gradle.org/docs/current/userguide/build_environment.html

 # Specifies the JVM arguments used for the daemon process.
 # The setting is particularly useful for tweaking memory settings.
 android.enableJetifier=true
 android.useAndroidX=true
 org.gradle.jvmargs=-Xmx1536m

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

In admob implementation guide no instruction is given to edit androidmanifest.xml file. Here's my androidmanifest.xml file.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.theaccidentalmedico.sociology">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>

 <application
    android:allowBackup="true"
    android:networkSecurityConfig="@xml/network_security_config"
    android:icon="@mipmap/ic_launcher_foreground"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppThemeDefault"
    tools:targetApi="n">
    <meta-data
        android:name="com.google.android.gms.ads.APPLICATION_ID"
        android:value="ca-app-pub-8803330956819211~8267554096"/>
    <activity
        android:name="com.theaccidentalmedico.sociology.MainTabActivity"
        android:configChanges="orientation|keyboardHidden|navigation|screenSize"
        android:windowSoftInputMode="adjustPan|adjustResize"
        android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.theaccidentalmedico.sociology.MainActivity"
        android:configChanges="orientation|keyboardHidden|navigation|screenSize" />
    <activity
        android:name="com.theaccidentalmedico.sociology.MeaningActivity"
        android:label="@string/title_meaning_activity" />
    <activity android:name="com.theaccidentalmedico.sociology.FavoriteActivity" />
    <activity android:name="com.theaccidentalmedico.sociology.SettingActivity" />
    <activity android:name="com.theaccidentalmedico.sociology.HistoryActivity"/>
</application>

</manifest>
Nehemiah Narzary
  • 336
  • 4
  • 11

2 Answers2

1

SOLVED

This problem with Mopub was because of mediation test suite 1.3.0.

Solution:

Go to you app-level build.gradle and change mediation test suite version to 1.4.0.

That solves the problem.

https://groups.google.com/g/google-admob-ads-sdk/c/NGMX-2P-sAM/m/v32f4uEhAAAJ

Nehemiah Narzary
  • 336
  • 4
  • 11
0

Add to AndroidManifest.xml

<activity android:name="com.mopub.mobileads.MoPubActivity"
          android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="com.mopub.mobileads.MraidActivity"
          android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="com.mopub.common.MoPubBrowser"
          android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="com.mopub.mobileads.MraidVideoPlayerActivity"
          android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="com.mopub.mobileads.RewardedMraidActivity"
          android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="com.mopub.common.privacy.ConsentDialogActivity"
          android:configChanges="keyboardHidden|orientation|screenSize"/>
  • This is no longer necessary if you are integrating MoPub v5.10.0 or newer. See https://developers.mopub.com/publishers/android/integrate/#step-3-update-your-android-manifest. – andzrev Sep 08 '20 at 02:06