Removing Google Play Services jars (DEF-3858) (SOLVED)

When building my admob extension I now get an error

Failed building Android resources to R.java: Failed building Android resources to R.java: /var/folders/hz/pn_wgvvs5gs9t_2zkchyd0w80000gn/T/tmp2299451986669050309bundle/resources/values/values.xml:39: error: Attribute "imageAspectRatioAdjust" already defined with incompatible format.
/var/folders/hz/pn_wgvvs5gs9t_2zkchyd0w80000gn/T/5298013932805045127/res/com.google.android.gms.play-services-base-16.0.1/values/values.xml:35: Original attribute defined here.
/var/folders/hz/pn_wgvvs5gs9t_2zkchyd0w80000gn/T/tmp2299451986669050309bundle/resources/values/values.xml:52: error: Attribute "buttonSize" already defined with incompatible format.
/var/folders/hz/pn_wgvvs5gs9t_2zkchyd0w80000gn/T/5298013932805045127/res/com.google.android.gms.play-services-base-16.0.1/values/values.xml:48: Original attribute defined here.
/var/folders/hz/pn_wgvvs5gs9t_2zkchyd0w80000gn/T/tmp2299451986669050309bundle/resources/values/values.xml:60: error: Attribute "colorScheme" already defined with incompatible format.
/var/folders/hz/pn_wgvvs5gs9t_2zkchyd0w80000gn/T/5298013932805045127/res/com.google.android.gms.play-services-base-16.0.1/values/values.xml:56: Original attribute defined here.

But I have excludeJars section in the game.appmanifest

platforms:
    armv7-android:
        context:
            excludeJars: ["(.*)/google-play-services.jar", "(.*)/android-support-v4.jar"]

Starting not so long ago with an update.

3 Likes

Not sure if it helps, but you can perhaps also remove the firebase jar file:

excludeJars: ["(.*)/google-play-services.jar", "(.*)/android-support-v4.jar", "(.*)/firebase-14.3.4.jar"]

EDIT: Updating to firebase was step 1. Next, we’ll move the entire Push extension out into an external extension.

2 Likes

Thanks, but still the same.

I’m looking into this, added an issue: DEF-3858

2 Likes

A quick update; me and @Mathias_Westerdahl are discussing how to properly solve these kinds of issues.

In the meantime, I managed to build the admob extension by removing the following lines from admob/res/android/res/values/values.xml:

<declare-styleable name="SignInButton"><attr name="buttonSize" format="reference">
<enum name="standard" value="0"/>

<enum name="wide" value="1"/>

<enum name="icon_only" value="2"/>

</attr>
<attr name="colorScheme" format="reference">
<enum name="dark" value="0"/>

<enum name="light" value="1"/>

<enum name="auto" value="2"/>

</attr>

<attr name="scopeUris" format="reference|string"/>
</declare-styleable>

Hopefully you are able to continue with this as a workaround while we try to figure out a more sane way to handle these conflicts, Android dependencies and resources… :fearful:

5 Likes

We don’t have any resources in the engine itself starting Defold 1.2.162

3 Likes