coolishbee / universal-sdk-unity

The Universal SDK for Unity provides a modern way of implementing Social Login APIs.
45 stars 11 forks source link

Graddle error (colliding-attributes) when Facebook SDK is already installed #1

Closed RRuas closed 2 years ago

RRuas commented 2 years ago

As my app already uses the Facebbok SDK , it´s AndroidManifest.xml, located at \Assets\Plugins\Android, has the folowing entry:

     <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="fbXXXXXXXXXXXXXX" />

Due to the existence of this entry, I´m getting the folowing error when trying to build after installing Universal SDK:

    Attribute meta-data#com.facebook.sdk.ApplicationId@value value=(fbXXXXXXXXXXXXXX) from [:unityLibrary] 
     AndroidManifest.xml:90:13-47 is also present at 
       [:io.github.jameschun7.universalsdk-1.1.5:] AndroidManifest.xml:42:13-52 value=(@string/facebook_app_id).
coolishbee commented 2 years ago

In the Facebook sdk, meta-data is an initialization trigger. <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="...." /> So it has to be declared internally in the sdk.

Currently a workaround is to merge the manifest. example:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" //added
    package="com.universal.sdktest">
    ...

    <application
        ...

        <meta-data
            tools:replace="android:value" //added
            android:name="com.facebook.sdk.ApplicationId"
            android:value="..." />
    </application>
</manifest>

However, facebook login of universal sdk is not available.

RRuas commented 2 years ago

I´ve modified the manifest, adding the attribute "tools:replace" as suggested and the error was solved.

However, facebook login of universal sdk is not available.

Login via Universal SDK continued to work after the modification