2

I have an error in Unity while building game into Android phone. Its 5th day while searching for solution. I've searched all over internet for similar problems, most of them was related to google play services, but i dont have them in my projects. I use unity ads and from error message its something related with it. I've reinstalled Android SDK, downloaded latest build-tools, last API 23 and still nothing. I've tried: -copying aapt.exe from build-tools folder into tools folder -downloading older version of build tools -checking android path for spaces

I don't have any more ideas... please help, Iam using Unity 5.3.1f1, Win8 64 bit unity external tools paths android SDK

    Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details.
    C:\Android\sdk\build-tools\23.0.3\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.google.android.gms.ads:com.google.android.gms.ads:com.google.android.gms:com.google.android.gms:android.support.v4:android.support.v4:com.unity3d.ads.android -S "C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\play-services-ads-8.3.0\res" -S "C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\play-services-ads-8.4.0\res" -S "C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\play-services-basement-8.3.0\res" -S "C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\play-services-basement-8.4.0\res" -S "C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\support-v4-23.1.0\res" -S "C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\support-v4-23.1.1\res" -S "C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res"

    stderr[
    C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml:2: note: removing attribute http://schemas.android.com/apk/res/android:paddingStart from <RelativeLayout>
    C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml:61: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <TextView>
    C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml:27: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentStart from <RelativeLayout>
    C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml:27: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <RelativeLayout>
    C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml:52: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <View>
    C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml:44: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <View>
    C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml:19: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentStart from <View>
    C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml:10: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <View>
    C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_audio_toggle.xml: note: using v17 attributes; synthesizing resource com.PrettyFlyGames.Cubic:layout/unityads_button_audio_toggle for configuration v17.
    C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_pause.xml:8: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <View>
    C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_button_pause.xml: note: using v17 attributes; synthesizing resource com.PrettyFlyGames.Cubic:layout/unityads_button_pause for configuration v17.
    C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_view_video_play.xml:92: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentStart from <include>
    C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_view_video_play.xml:57: note: removing attribute http://schemas.android.com/apk/res/android:layout_alignParentEnd from <LinearLayout>
    C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_view_video_play.xml:57: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginEnd from <LinearLayout>
    C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_view_video_play.xml:44: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginEnd from <TextView>
    C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_view_video_play.xml:29: note: removing attribute http://schemas.android.com/apk/res/android:layout_marginStart from <TextView>
    C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\layout\unityads_view_video_play.xml: note: using v17 attributes; synthesizing resource com.PrettyFlyGames.Cubic:layout/unityads_view_video_play for configuration v17.
    C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\play-services-basement-8.3.0\res\values\common_attrs.xml:13: error: Attribute "imageAspectRatioAdjust" has already been defined

    C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\play-services-basement-8.3.0\res\values\common_attrs.xml:22: error: Attribute "imageAspectRatio" has already been defined

    C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\play-services-basement-8.3.0\res\values\common_attrs.xml:27: error: Attribute "circleCrop" has already been defined

    C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\play-services-ads-8.3.0\res\values\admob_ads_attrs.xml:10: error: Attribute "adSize" has already been defined

    C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\play-services-ads-8.3.0\res\values\admob_ads_attrs.xml:17: error: Attribute "adSizes" has already been defined

    C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\play-services-ads-8.3.0\res\values\admob_ads_attrs.xml:20: error: Attribute "adUnitId" has already been defined

    ]
    stdout[
    Configurations:
     (default)

    Files:
      drawable\unityads_background_button_pause.xml
Src: () C:\Users\Gosia & Kuba\Desktop\Kuba\UNITY\Cube\Temp\StagingArea\android-libraries\unityads-release\res\drawable\unityads_background_button_pause.xml

etc etc (...) it is very long

EDIT: sdk extras google play services folder

drapichrust
  • 77
  • 1
  • 2
  • 9

2 Answers2

0

You have downloaded:

Google Play Services

Android Support Library

enter image description here

For similar problems check this:

Can't build Unity project after adding google play games!

Failed to resolve: com.android.support:support-v4:23.0.0

Google Mobile Ad Plugin & Google Play Services (SOLVED)

Community
  • 1
  • 1
  • Well, I've deleted and installed again Google play services although i dont use them in my project. Also installed other extras as shown below. I dont have Anroid Support Library to download as on your screen, why?? Build Error still occurs. Interestingly I've checked folder of 'extras/google/google_play_services' and it seems to be empty, there is no folder "google-play-services_lib"...wtf? check new screens; – drapichrust Jun 01 '16 at 20:19
0

ok I've followed kennytm link and removed all google play & support plugins from project Plugins >Android folder and game builded succesfully. Funny i don't remember adding those plugins or when they appear. But game works for now.unity plugins

EDIT: plugins were from GameAnalytics SDK which i was using, after deleting files it stopped working:D but after reinstall to newest version everything was back to normal

drapichrust
  • 77
  • 1
  • 2
  • 9