Error when trying to build and push admob to Android

I have an application in unity and installed the google admob unity plugin. I also used an admanager gameobject in the game scene that has a script attached:

using GoogleMobileAds.Api;
// Create a 320x50 banner at the top of the screen.
BannerView bannerView = new BannerView(
        "YOUR_AD_UNIT_ID", AdSize.Banner, AdPosition.Top);
// Create an empty ad request.
AdRequest request = new AdRequest.Builder().Build();
// Load the banner with the request.

The ad unit id i got from admob’s website after I manually added the application:

CommandInvokationFailure: Failed to re-package resources. See the Console for details.
aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S “res” -I
AndroidManifest.xml:16: error: Error: No resource found that matches the given name (at ‘theme’ with value ‘@style/Theme.IAPTheme’).

Could this be a missing file/xml/configuration issue?

Took me a day to solve this myself. What a pain, but I found the plugin on Github and found in the readme there the following that solved my build…

Android Setup

Add the google-play-services_lib folder, located at ANDROID_SDK_LOCATION/extras/google/google_play_services/libproject, into the Plugins/Android folder of your project.

[For users running a version of Unity earlier than 5.0] Navigate to Temp/StagingArea of your project directory and copy AndroidManifest.xml to Assets/Plugins/Android. Add the following tag to the AndroidManifest.xml file:

<activity android:name="com.unity3d.player.UnityPlayerActivity" ...>
  <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />

For me,

AndroidManifest.xml:16: error: Error: No resource found that matches the given name (at ‘theme’ with value ‘@style/Theme.IAPTheme’).

appeared when I was trying to upgrade unity 5.2 or 5.1 project to Unity 5.3 Project.I have to upgrade GooglePlayGamesPlugin because the old version of GooglePlayGamesPlugin had some errors about “Logger” in Unity 5.3.

I almost took one day on working with GoogPlayGamesPlugin and Admob to fix this problem as it appeared after importing new Version of GooglePlayServicePlugin(0.9.32)

The old project contained two unity ads folders called “Editor” and “UnityAds” in “StandardAssets”. Although the console told me a lot about unityAds but i did’t focus on it until I failed many times on GooglePlayGamesPlugin. After deleting and import UnityAd folders from other new Project, it worked well for me. Hope this experience can help someone else who encounter the same problem.

I solved when used the Google Mobile Ads Unity Plugin v2.0

I had the problem with gradle build switching to internal fixed it