playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.47k stars 966 forks source link

Build problem Failed To Repack Resource After adding google play game #1893

Closed misaghDroid closed 7 years ago

misaghDroid commented 7 years ago

Hi everybody, I have added ConsoliAds plugin to my project and i can build android properly. But when I add Google Play Game plugin, during the build process I got Failed to re-package resources.

There is an image before adding google play games

error1

There is an image after adding google play game

error2

During the build process I got Failed to re-package resources and these logs appear in the console. I'm using the latest version of ConsoliAds and Google Play Game

CommandInvokationFailure: Failed to re-package resources. See the Console for details.
D:\ANDROID\AndroidSDK\build-tools\23.0.3\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "D:/ANDROID/AndroidSDK\platforms\android-23\android.jar" -F bin/resources.ap_ --extra-packages com.chartboost.sdk.unity:com.google.unity:com.heyzap:com.google.example.games.mainlibproj:com.google.android.gms.auth.api:com.google.android.gms.auth:com.google.android.gms.drive:com.google.android.gms.games:com.google.android.gms.nearby:com.Company.ProductName:android.support.compat:android.support.coreui:android.support.coreutils:android.support.fragment:android.support.mediacompat:android.support.v4:com.papata.btb:com.unity3d.ads -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-auth-11.0.4\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-auth-base-11.0.4\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-drive-11.0.4\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-games-11.0.4\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-nearby-11.0.4\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\support-compat-25.2.0\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\support-core-ui-25.2.0\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\support-core-utils-25.2.0\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\support-fragment-25.2.0\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\support-media-compat-25.2.0\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\support-v4-23.0.0\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\unity-android-resources\res" -S "E:\Hashtomin2\Temp\StagingArea\android-libraries\UnityAds\res"

stderr[
E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-auth-11.0.4\res\drawable-watch-v20\common_google_signin_btn_text_dark_normal.xml:9: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/googleg_standard_color_18').

E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-auth-11.0.4\res\drawable-watch-v20\common_google_signin_btn_text_disabled.xml:16: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/googleg_disabled_color_18').

E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-auth-11.0.4\res\drawable-watch-v20\common_google_signin_btn_text_light_normal.xml:9: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/googleg_standard_color_18').

]
stdout[
Configurations:
 (default)

Files:
  AndroidManifest.xml
    Src: () AndroidManifest.xml

Resource Dirs:
Including resources from package: D:\ANDROID\AndroidSDK\platforms\android-23\android.jar
applyFileOverlay for drawable
trying overlaySet Key=common_google_signin_btn_text_dark_normal.xml
trying overlaySet Key=common_google_signin_btn_text_disabled.xml
trying overlaySet Key=common_google_signin_btn_text_light_normal.xml
trying overlaySet Key=app_banner.png
trying overlaySet Key=app_icon.png
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: 99% size of source)
Processing image: res\drawable-ldpi\app_icon.png
Processing image: res\drawable-hdpi\app_icon.png
    (processed image res\drawable-ldpi\app_icon.png: 98% size of source)
Processing image: res\drawable-xhdpi\app_icon.png
    (processed image res\drawable-hdpi\app_icon.png: 99% size of source)
Processing image: res\drawable-xxhdpi\app_icon.png
    (processed image res\drawable-xhdpi\app_icon.png: 99% size of source)
Processing image: res\drawable-xxxhdpi\app_icon.png
    (processed image res\drawable-xhdpi\app_banner.png: 93% size of source)
    (processed image res\drawable-xxhdpi\app_icon.png: 99% size of source)
    (processed image res\drawable-xxxhdpi\app_icon.png: 99% 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)
    (new resource id app_icon from ldpi-v4\drawable\app_icon.png #generated)
    (new resource id app_icon from hdpi-v4\drawable\app_icon.png #generated)
    (new resource id app_icon from xhdpi-v4\drawable\app_icon.png #generated)
    (new resource id app_icon from xxhdpi-v4\drawable\app_icon.png #generated)
    (new resource id app_icon from xxxhdpi-v4\drawable\app_icon.png #generated)
    (new resource id common_google_signin_btn_text_dark_normal from E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-auth-11.0.4\res\drawable-watch-v20\common_google_signin_btn_text_dark_normal.xml)
    (new resource id common_google_signin_btn_text_disabled from E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-auth-11.0.4\res\drawable-watch-v20\common_google_signin_btn_text_disabled.xml)
    (new resource id common_google_signin_btn_text_light_normal from E:\Hashtomin2\Temp\StagingArea\android-libraries\play-services-auth-11.0.4\res\drawable-watch-v20\common_google_signin_btn_text_light_normal.xml)
]
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.PostProcessAndroidPlayer.Exec (System.String command, System.String args, System.String workingdir, System.String[] progress_strings, Single progress_value, System.String errorMsg)
UnityEditor.Android.PostProcessAndroidPlayer.CompileResources (System.String stagingArea, System.String packageName, UnityEditor.Android.AndroidLibraries androidLibraries)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcessInternal (System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
UnityEditor.HostView:OnGUI()
claywilkinson commented 7 years ago

You should have only 1 version (the greatest) of the firebase and play-services aar files. For example use only 11.0.4 for all the aars. (You might need to update Firebase SDK to a more recent version too).

misaghDroid commented 7 years ago

@claywilkinson I passed this problem by updating the ConsoliAds plugin to latest version and there aren't any Firebases aar or jar files after that I commented some lines in Values.xml in the res folder.

<resources xmlns:ns1="urn:oasis:names:tc:xliff:document:1.2">
    <!--<declare-styleable name="LoadingImageView">
    <attr format="enum" name="imageAspectRatioAdjust">
    <enum name="none" value="0"/>
    <enum name="adjust_width" value="1"/>
    <enum name="adjust_height" value="2"/>
    </attr><attr format="float" name="imageAspectRatio"/>
    <attr format="boolean" name="circleCrop"/>
    </declare-styleable> -->
    <!-- From: file:/tmp/aar_gen_tmp3462974426155758594/tmp-deduplicated/blaze-out/gcc-4.X.Y-crosstool-v18-hybrid-grtev4-k8-opt/genfiles/java/com/google/android/gmscore/integ/res/values/gmscore_version.xml -->
    <eat-comment/>
    <integer name="google_play_services_version">9683000</integer>
    <!-- From: file:/tmp/aar_gen_tmp3462974426155758594/tmp-deduplicated/java/com/google/android/gmscore/integ/client/common/res/values/strings.xml -->
    <eat-comment/>
    <string name="common_google_play_services_unknown_issue"><ns1:g id="app_name">%1$s</ns1:g> is having trouble with Google Play services. If the problem persists, please contact the developer for assistance.</string>
</resources>

I updated Resolve Client Jar plugin to the latest version from here, then ran it. After that I got another problem during the build process.

Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
C:/Program Files/Java/jdk1.8.0_131\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="D:/ANDROID/AndroidSDK\tools" -Dfile.encoding=UTF8 -jar "D:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -

stderr[
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.a.a.b) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.a.a.c) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.a.a.d) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.a.a.e) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.adjust.sdk.b) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.adjust.sdk.c) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.adjust.sdk.e) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.adjust.sdk.ac) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.appitup.sdk.b) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.appitup.sdk.c) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.appitup.sdk.d) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.appitup.sdk.d.e) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.appitup.sdk.e) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.appitup.sdk.h) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.appitup.sdk.j) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.appitup.sdk.n) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.appitup.sdk.o) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.appitup.sdk.p) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.appitup.sdk.q) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.appitup.sdk.r) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.appitup.sdk.s) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.appitup.sdk.t) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.appitup.sdk.u) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.appitup.sdk.v) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.appitup.sdk.w) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.appsflyer.e) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.appsflyer.l) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.appsflyer.x) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.b.a.b) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/zzut;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/zzuu;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/g<message truncated>
misaghDroid commented 7 years ago

My Problem solved. I had the aar file from previous version of ConsoliAds plugin named consoliads-skd.jar and in the new version it has changed to consoliadsplugin.jar. I removed the old one, so my problem solved. I've added these lines to GPGSDependencies.cs to import automatically .aar files related to ConsoliAds.

Google.VersionHandler.InvokeInstanceMethod(
            svcSupport, "DependOn",
            new object[] { "com.google.android.gms", "play-services-ads",
                           PluginVersion.PlayServicesVersionConstraint },
            namedArgs: new Dictionary<string, object>() {
                {"packageIds", new string[] {
                        "extra-google-m2repository"} }
            });