Hi,
If I import only Google Mobile Ad Plugin OR Google Play Services it is working. But when I import those components together, Unity shows an error. I tried all solutions on the internet, but they don’t work. I tried different ad plugins but they don’t work either. Please help me. I have been trying all solutions for a week. Can anybody upload an empty Unity project with those two components included? (working on Android phone)
IMPORTANT : Those components work in my project. Ads are shown and clickable. Leaderboards work too. I don’t think the problem is with my system. Those components don’t work together.
I don’t understand this. Play services well working alone. It is throw error import google ad component. (play games component deleting play-services-lib folder)
CommandInvokationFailure: Failed to re-package resources. See the Console for details.
D:\01.07.2015\android-sdks\build-tools\23.0.2\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "D:/01.07.2015/android-sdks\platforms\android-23\android.jar" -F bin/resources.ap_ --extra-packages android.support.v7.appcompat:com.google.unity:com.google.example.games.mainlibproj:com.google.android.gms.base:com.google.android.gms:com.google.android.gms.drive:com.google.android.gms.games:com.google.android.gms.nearby:com.google.android.gms.plus:android.support.v4 -S "C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res" -S "C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\play-services-base-8.3.0\res" -S "C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\play-services-basement-8.3.0\res" -S "C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\play-services-drive-8.3.0\res" -S "C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\play-services-games-8.3.0\res" -S "C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\play-services-nearby-8.3.0\res" -S "C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\play-services-plus-8.3.0\res" -S "C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\support-v4-23.1.1\res"
stderr[
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_alert_dialog_button_bar_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:layoutDirection from <android.support.v7.widget.ButtonBarLayout>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_alert_dialog_button_bar_material.xml: note: using v17 attributes; synthesizing resource com.AleladeStudio.Reflexable:layout/abc_alert_dialog_button_bar_material for configuration v17.
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_alert_dialog_material.xml:48: note: removing attribute http://schemas.android.com/apk/res/android:textAlignment from <android.support.v7.widget.DialogTitle>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_alert_dialog_material.xml: note: using v17 attributes; synthesizing resource com.AleladeStudio.Reflexable:layout/abc_alert_dialog_material for configuration v17.
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_dialog_title_material.xml:29: note: removing attribute http://schemas.android.com/apk/res/android:textAlignment from <TextView>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_dialog_title_material.xml: note: using v17 attributes; synthesizing resource com.AleladeStudio.Reflexable:layout/abc_dialog_title_material for configuration v17.
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_screen_toolbar.xml:27: note: removing attribute http://schemas.android.com/apk/res/android:touchscreenBlocksFocus from <android.support.v7.widget.ActionBarContainer>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_screen_toolbar.xml: note: using v21 attributes; synthesizing resource com.AleladeStudio.Reflexable:layout/abc_screen_toolbar for configuration v21.
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_search_view.xml:47: note: removing attribute http://schemas.android.com/apk/res/android:layoutDirection from <LinearLayout>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\abc_search_view.xml: note: using v17 attributes; synthesizing resource com.AleladeStudio.Reflexable:layout/abc_search_view for configuration v17.
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media.xml:42: note: removing attribute http://schemas.android.com/apk/res/android:layoutDirection from <LinearLayout>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media.xml:34: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <include>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media.xml:34: note: removing attribute http://schemas.android.com/apk/res/android:layout_toStartOf from <include>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media.xml: note: using v17 attributes; synthesizing resource com.AleladeStudio.Reflexable:layout/notification_template_big_media for configuration v17.
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media_narrow.xml:60: note: removing attribute http://schemas.android.com/apk/res/android:layout_toEndOf from <ImageView>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media_narrow.xml:46: note: removing attribute http://schemas.android.com/apk/res/android:layout_toEndOf from <LinearLayout>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media_narrow.xml:46: note: removing attribute http://schemas.android.com/apk/res/android:layoutDirection from <LinearLayout>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media_narrow.xml:38: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <include>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media_narrow.xml:38: note: removing attribute http://schemas.android.com/apk/res/android:layout_toStartOf from <include>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media_narrow.xml:30: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentEnd from <include>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_big_media_narrow.xml: note: using v17 attributes; synthesizing resource com.AleladeStudio.Reflexable:layout/notification_template_big_media_narrow for configuration v17.
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_lines.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingEnd from <LinearLayout>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_lines.xml:77: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <LinearLayout>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_lines.xml:96: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <TextView>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_lines.xml:64: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <TextView>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_lines.xml:27: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <LinearLayout>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_lines.xml: note: using v17 attributes; synthesizing resource com.AleladeStudio.Reflexable:layout/notification_template_lines for configuration v17.
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_media.xml:43: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginEnd from <include>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_media.xml:33: note: removing attribute http://schemas.android.com/apk/res/android:layoutDirection from <LinearLayout>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_media.xml: note: using v17 attributes; synthesizing resource com.AleladeStudio.Reflexable:layout/notification_template_media for configuration v17.
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_part_chronometer.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <Chronometer>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_part_chronometer.xml: note: using v17 attributes; synthesizing resource com.AleladeStudio.Reflexable:layout/notification_template_part_chronometer for configuration v17.
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_part_time.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <DateTimeView>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\notification_template_part_time.xml: note: using v17 attributes; synthesizing resource com.AleladeStudio.Reflexable:layout/notification_template_part_time for configuration v17.
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_multichoice_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <CheckedTextView>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_multichoice_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingEnd from <CheckedTextView>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_multichoice_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:drawableStart from <CheckedTextView>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_multichoice_material.xml: note: using v13 attributes; synthesizing resource com.AleladeStudio.Reflexable:layout/select_dialog_multichoice_material for configuration v13.
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_singlechoice_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <CheckedTextView>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_singlechoice_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingEnd from <CheckedTextView>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_singlechoice_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:drawableStart from <CheckedTextView>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_singlechoice_material.xml: note: using v13 attributes; synthesizing resource com.AleladeStudio.Reflexable:layout/select_dialog_singlechoice_material for configuration v13.
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\drawable\abc_textfield_search_material.xml:19: note: removing attribute http://schemas.android.com/apk/res/android:state_activated from <item>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\drawable\abc_textfield_search_material.xml: note: using v11 attributes; synthesizing resource com.AleladeStudio.Reflexable:drawable/abc_textfield_search_material for configuration v11.
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_multichoice_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <CheckedTextView>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_multichoice_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingEnd from <CheckedTextView>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_multichoice_material.xml: note: using v17 attributes; synthesizing resource com.AleladeStudio.Reflexable:layout/select_dialog_multichoice_material for configuration v17.
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_singlechoice_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <CheckedTextView>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_singlechoice_material.xml:18: note: removing attribute http://schemas.android.com/apk/res/android:paddingEnd from <CheckedTextView>
C:\Users\HP\Desktop\Unity Projects\Reflexable\Temp\StagingArea\android-libraries\appcompat-v7-23.1.1\res\layout\select_dialog_singlechoice_material.xml: note: using v17 attributes; synthesizing resource com.AleladeStudio.Reflexable:layout/select_dialog_singlechoice_material for configuration v17.
AndroidManifest.xml:16: error: Error: No resource found that matches the given name (at 'theme' with value ' @ /Theme.IAPTheme').
]
stdout[
Configurations:
(default)
Files:
AndroidManifest.xml
Src: () AndroidManifest.xml
Resource Dirs:
Including resources from package: D:\01.07.2015\android-sdks\platforms\android-23\android.jar
applyFileOverlay for drawable
trying overlaySet Key=ic_plusone_medium_off_client.png
trying overlaySet Key=ic_plusone_small_off_client.png
trying overlaySet Key=ic_plusone_standard_off_client.png
trying overlaySet Key=ic_plusone_tall_off_client.png
trying overlaySet Key=common_full_open_on_phone.png
trying overlaySet Key=common_ic_googleplayservices.png
trying overlaySet Key=common_google_signin_btn_icon_dark.xml
trying overlaySet Key=common_google_signin_btn_icon_dark_disabled.9.png
trying overlaySet Key=common_google_signin_btn_icon_dark_focused.9.png
trying overlaySet Key=common_google_signin_btn_icon_dark_normal.9.png
trying overlaySet Key=common_google_signin_btn_icon_dark_pressed.9.png
trying overlaySet Key=common_google_signin_btn_icon_light.xml
trying overlaySet Key=common_google_signin_btn_icon_light_disabled.9.png
trying overlaySet Key=common_google_signin_btn_icon_light_focused.9.png
trying overlaySet Key=common_google_signin_btn_icon_light_normal.9.png
trying overlaySet Key=common_google_signin_btn_icon_light_pressed.9.png
trying overlaySet Key=c<message truncated>
Google Ad mob AndroidManifest.xml (APPID chanced *)
<?xml version="1.0" encoding="utf-8"?>
<!-- This file was automatically generated by the Google Play Games plugin for Unity
Do not edit. -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.example.games.mainlibproj"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16" />
<!-- replaced during setup -->
<application>
<!-- Required for Nearby Connections API -->
<meta-data android:name="com.google.android.gms.nearby.connection.SERVICE_ID"
android:value="" />
<!-- the space in these forces it to be interpreted as a string vs. int -->
<meta-data android:name="com.google.android.gms.games.APP_ID"
android:value="\ 55*******" />
<meta-data android:name="com.google.android.gms.appstate.APP_ID"
android:value="\ 55********" />
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity android:name="com.google.games.bridge.NativeBridgeActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
</application>
</manifest>
google play services AndroidManifest.xml in the MainLibProj folder
<?xml version="1.0" encoding="utf-8"?>
<!-- This file was automatically generated by the Google Play Games plugin for Unity
Do not edit. -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.example.games.mainlibproj"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16" />
<!-- replaced during setup -->
<application>
<!-- Required for Nearby Connections API -->
<meta-data android:name="com.google.android.gms.nearby.connection.SERVICE_ID"
android:value="" />
<!-- the space in these forces it to be interpreted as a string vs. int -->
<meta-data android:name="com.google.android.gms.games.APP_ID"
android:value="\ 55******" />
<meta-data android:name="com.google.android.gms.appstate.APP_ID"
android:value="\ 55*****" />
<meta-data android:name="com.google.android.gms.version"
android:value=" @dacloo /google_play_services_version" />
<activity android:name="com.google.games.bridge.NativeBridgeActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
</application>
</manifest>
I am having the same problem with Unity 5.3.2f1 Admob V. 3.0.1 and GPGS 8.4.0, GPGS was working fine but after adding admob it is not connecting anymore and also ads are not showing.
What i have noticed is that when i include admob plugin and tweaks by @mostrolabs it deletes play-services-basement-8.4.0.aar file from plugin\android folder that seems to me the issue?
yeah the problem is that Admob plugin together with google play plugin is a mess. If you install admob plugin it will remove your play-services-basement aar and also add the play-services-ads
and no matter how you try to fix it later, it won’t work, because it seems to patch something on your sdk installation and it will remove and add that file ALL THE TIME and make unity build fail.
Someone deserves to be hang at Google for this. I don’t know how many hours people lost trying to solve it. (I’ve spent 2 days, after a nice email from google asking me to try their wonderful google admob… worst decision ever!)
How to fix it? If you don’t want admob (which I don’t after this awesome experience).
Close unity, remove the ads aar, put back the basement aar. Important to have Unity closed because it will try to restore whatever you change otherwise.
Then edit the BackgroundResolution.cs file… and comment out all the inside of OnPostprocessAllAssets method.
Now you can open unity. FINALLY it won’t try to adjust it.
If you want Admob?
I guess you can do the same but leave the ads aar inside. I haven’t tried it because I’m swearing on it right now, cursing it and asking for whoever created the plugin to be punished by Chuck Norris.
This all long solution was not needed for me, I had just updated the Java version to jdk1.8.0_91
Update environment variables
JAVA_HOME - C:\Program Files\Java\jdk1.8.0_91
PATH=%PATH%;C:\Program Files\Java\jdk1.8.0_91\bin
yeah they finally fixed it on may or so. Now the created a new problem though, if you import google play and Facebook sdk, your iOS build will fail. It makes unity crash. Already reported it a month ago.