Title says it all. I created a new Unity Project, added the MoPubPlugin.unitypackage (latest version v3.8.0), and tried to build an APK. It says “Failed to re-package resources. See the Console for details.” In the console there are two copies of the same error:
Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details. C:\Android\sdk\build-tools\23.0.2\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Android/sdk\platforms\android-23\android.jar" -F bin/resources.ap_ --extra-packages com.prime31.NAME stderr[ AndroidManifest.xml:28: error: Error: No resource found that matches the given name (at 'value' with value '@integer/google_play_services_version'). ] stdout[ Configurations: (default) xhdpi-v4 Files: drawable\app_banner.png Src: (xhdpi-v4) res\drawable-xhdpi\app_banner.png drawable\app_icon.png Src: () res\drawable\app_icon.png values\strings.xml Src: () res\values\strings.xml AndroidManifest.xml Src: () AndroidManifest.xml Resource Dirs: Type drawable drawable\app_banner.png Src: (xhdpi-v4) res\drawable-xhdpi\app_banner.png drawable\app_icon.png Src: () res\drawable\app_icon.png Type values values\strings.xml Src: () res\values\strings.xml Including resources from package: C:\Android\sdk\platforms\android-23\android.jar applyFileOverlay for drawable applyFileOverlay for layout applyFileOverlay for anim applyFileOverlay for animator applyFileOverlay for interpolator applyFileOverlay for transition applyFileOverlay for xml applyFileOverlay for raw applyFileOverlay for color applyFileOverlay for menu applyFileOverlay for mipmap Processing image: res\drawable-xhdpi\app_banner.png Processing image: res\drawable\app_icon.png (processed image res\drawable\app_icon.png: 94% size of source) (processed image res\drawable-xhdpi\app_banner.png: 93% size of source) (new resource id app_banner from xhdpi-v4\drawable\app_banner.png #generated) (new resource id app_icon from drawable\app_icon.png #generated) ]
I tried to add the google play services library, but this caused its own issues and according to this quote it sounds like I should NOT need to do this:
The MoPub SDK can mediate most ad networks through our server-to-server integrations, pre-built adapters, and custom events capabilities. A full list of supported networks can be found here.
We offer pre-built adaptors for AdColony, AdMob, Chartboost, Facebook Audience Network, Millennial Media, UnityAds (interstitials only), and Vungle. To set these integrations up, follow the instructions below.
Since I’m just trying to get set up, I’m ok with doing only server-to-server ads, if it would work. I understand that I could probably manually edit the AndroidManifest.xml to include a play-services version number, but since this isn’t mentioned anywhere in the setup guide I’m thinking it isn’t the right way to go.
Also I made sure that my android tools are all up-to-date, and in Android SDK Mgr I added the Google Play Services package which wasnt installed by default. But the results are the same. I cannot build the example scene, nor can I build even an empty scene.
EDIT: Actually I didn’t need to set a GPS version to get it to build, I simply needed to delete this line from Plugins/Android/MoPub_lib/AndroidManifest.xml
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
So it’s compiling now, but it worries me that this will cause issues later… if someone could explain why the package doesn’t compile as downloaded, I’d love to know. Thanks!