Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Conflict with Firebase breaks Android build on Unity v6000.0.23f1 #3652

Open
playjoa opened this issue Oct 22, 2024 · 10 comments
Open

Comments

@playjoa
Copy link

playjoa commented Oct 22, 2024

[REQUIRED] Step 1: Describe your environment

  • Unity version: v6000.0.23f1
  • Google Mobile Ads Unity plugin version: v9.2.1.
  • Plugin installation method: SDK Manual Import
  • Platform: Android
  • Platform OS version: Any Android

[REQUIRED] Step 2: Describe the problem

Having my project setup with latest Firebase v12.3.0 (Analytics, Crashanalytics, Auth, FireStore) and AdMob v9.2.1. I can't get a build to run. Keep getting a conflict error. Already tried cleaning project, re-importing. Started happening after I upgraded project version to Unity 6, was on Unity v2022.3.28f1 before.

Steps to reproduce:

Try build project for Android with Firebase v12.3.0 (Analytics, Crashanalytics, Auth, FireStore) and AdMob v9.2.1.

Relevant Code:

Error:
	Attribute property#android.adservices.AD_SERVICES_CONFIG@resource value=(@xml/gma_ad_services_config) from [com.google.android.gms:play-services-ads-lite:23.4.0] AndroidManifest.xml:109:13-59
	is also present at [com.google.android.gms:play-services-measurement-api:22.1.0] AndroidManifest.xml:32:13-58 value=(@xml/ga_ad_services_config).
	Suggestion: add 'tools:replace="android:resource"' to <property> element at AndroidManifest.xml to override.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':launcher:processDebugMainManifest'.
> Manifest merger failed with multiple errors, see logs

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 3s
]
stdout[

> Configure project :unityLibrary
Variant 'debug', will keep symbols in binaries for:
  'libunity.so'
  'libil2cpp.so'
  'libmain.so'
Variant 'release', symbols will be stripped from binaries.

> Configure project :launcher
Variant 'debug', will keep symbols in binaries for:
  'libunity.so'
  'libil2cpp.so'
  'libmain.so'
Variant 'release', symbols will be stripped from binaries.

> Configure project :unityLibrary:FirebaseApp.androidlib
WARNING: minSdkVersion (23) is greater than targetSdkVersion (9) for variant "debug". Please change the values such that minSdkVersion is less than or equal to targetSdkVersion.
WARNING: minSdkVersion (23) is greater than targetSdkVersion (9) for variant "release". Please change the values such that minSdkVersion is less than or equal to targetSdkVersion.

> Configure project :unityLibrary:FirebaseCrashlytics.androidlib
WARNING: minSdkVersion (23) is greater than targetSdkVersion (9) for variant "debug". Please change the values such that minSdkVersion is less than or equal to targetSdkVersion.
WARNING: minSdkVersion (23) is greater than targetSdkVersion (9) for variant "release". Please change the values such that minSdkVersion is less than or equal to targetSdkVersion.

> Task :unityLibrary:preBuild UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:preBuild UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:preBuild UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:preBuild UP-TO-DATE
> Task :unityLibrary:preDebugBuild UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:preDebugBuild UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:preDebugBuild UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:preDebugBuild UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:writeDebugAarMetadata UP-TO-DATE
> Task :unityLibrary:writeDebugAarMetadata UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:writeDebugAarMetadata UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:writeDebugAarMetadata UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:generateDebugResValues UP-TO-DATE
> Task :unityLibrary:generateDebugResValues UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:generateDebugResValues UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:generateDebugResValues UP-TO-DATE
> Task :unityLibrary:generateDebugResources UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:generateDebugResources UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:generateDebugResources UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:packageDebugResources UP-TO-DATE
> Task :unityLibrary:packageDebugResources UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:packageDebugResources UP-TO-DATE
> Task :unityLibrary:extractDeepLinksDebug UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:extractDeepLinksDebug UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:extractDeepLinksDebug UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:processDebugManifest UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:processDebugManifest UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:compileDebugLibraryResources UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:compileDebugLibraryResources UP-TO-DATE
> Task :unityLibrary:compileDebugLibraryResources UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:parseDebugLocalResources UP-TO-DATE
> Task :unityLibrary:parseDebugLocalResources UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:parseDebugLocalResources UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:generateDebugRFile UP-TO-DATE
> Task :unityLibrary:generateDebugRFile UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:generateDebugRFile UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:javaPreCompileDebug UP-TO-DATE
> Task :unityLibrary:javaPreCompileDebug UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:javaPreCompileDebug UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:generateDebugResources
> Task :unityLibrary:mergeDebugShaders UP-TO-DATE
> Task :unityLibrary:compileDebugShaders NO-SOURCE
> Task :unityLibrary:generateDebugAssets UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:compileDebugJavaWithJavac NO-SOURCE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:compileDebugJavaWithJavac NO-SOURCE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:bundleLibCompileToJarDebug UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:bundleLibCompileToJarDebug UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:mergeDebugShaders UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:mergeDebugShaders UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:compileDebugShaders NO-SOURCE
> Task :unityLibrary:FirebaseApp.androidlib:generateDebugAssets UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:compileDebugShaders NO-SOURCE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:generateDebugAssets UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:packageDebugAssets UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:packageDebugAssets UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:bundleLibRuntimeToJarDebug UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:bundleLibRuntimeToJarDebug UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:processDebugJavaRes NO-SOURCE
> Task :unityLibrary:FirebaseApp.androidlib:processDebugJavaRes NO-SOURCE
> Task :unityLibrary:FirebaseApp.androidlib:mergeDebugJniLibFolders UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:mergeDebugJniLibFolders UP-TO-DATE
> Task :unityLibrary:FirebaseApp.androidlib:mergeDebugNativeLibs NO-SOURCE
> Task :unityLibrary:FirebaseApp.androidlib:copyDebugJniLibsProjectOnly UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:mergeDebugNativeLibs NO-SOURCE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:copyDebugJniLibsProjectOnly UP-TO-DATE
> Task :launcher:preBuild UP-TO-DATE
> Task :launcher:preDebugBuild UP-TO-DATE
> Task :launcher:mergeDebugNativeDebugMetadata NO-SOURCE
> Task :launcher:javaPreCompileDebug UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:packageDebugResources
> Task :unityLibrary:FirebaseCrashlytics.androidlib:extractDeepLinksDebug UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:processDebugManifest UP-TO-DATE
> Task :unityLibrary:processDebugManifest
> Task :unityLibrary:FirebaseCrashlytics.androidlib:javaPreCompileDebug UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:compileDebugLibraryResources
> Task :unityLibrary:FirebaseCrashlytics.androidlib:mergeDebugShaders UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:compileDebugShaders NO-SOURCE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:generateDebugAssets UP-TO-DATE
> Task :unityLibrary:packageDebugAssets
> Task :unityLibrary:FirebaseCrashlytics.androidlib:packageDebugAssets UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:processDebugJavaRes NO-SOURCE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:mergeDebugJniLibFolders UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:mergeDebugNativeLibs NO-SOURCE
> Task :unityLibrary:processDebugJavaRes UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:copyDebugJniLibsProjectOnly UP-TO-DATE
> Task :unityLibrary:mergeDebugJniLibFolders UP-TO-DATE
> Task :unityLibrary:mergeDebugNativeLibs UP-TO-DATE
> Task :unityLibrary:copyDebugJniLibsProjectOnly UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:parseDebugLocalResources
> Task :unityLibrary:FirebaseCrashlytics.androidlib:generateDebugRFile UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:compileDebugJavaWithJavac NO-SOURCE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:bundleLibCompileToJarDebug UP-TO-DATE
> Task :unityLibrary:FirebaseCrashlytics.androidlib:bundleLibRuntimeToJarDebug UP-TO-DATE
> Task :launcher:checkDebugAarMetadata UP-TO-DATE
> Task :launcher:generateDebugResValues UP-TO-DATE
> Task :launcher:mapDebugSourceSetPaths
> Task :launcher:generateDebugResources UP-TO-DATE
> Task :launcher:packageDebugResources UP-TO-DATE
> Task :launcher:parseDebugLocalResources UP-TO-DATE
> Task :launcher:createDebugCompatibleScreenManifests UP-TO-DATE
> Task :launcher:extractDeepLinksDebug UP-TO-DATE

> Task :launcher:processDebugMainManifest FAILED
[:googlemobileads-unity:] /Users/joaomilone/.gradle/caches/transforms-3/2adf763a88339aa813b590b6623a66a0/transformed/jetified-googlemobileads-unity/AndroidManifest.xml Warning:
	Namespace 'com.google.unity.ads' is used in multiple modules and/or libraries: :googlemobileads-unity:, :unityLibrary:GoogleMobileAdsPlugin.androidlib. Please ensure that all modules and libraries have a unique namespace. For more information, See https://developer.android.com/studio/build/configure-app-module#set-namespace
@NVentimiglia
Copy link
Member

@playjoa

Can you please clear out your export folder and try again, I was able to build the project with Firebase on Android using Unity 6.

@playjoa
Copy link
Author

playjoa commented Oct 23, 2024

@playjoa

Can you please clear out your export folder and try again, I was able to build the project with Firebase on Android using Unity 6.

You mean the "Library" folder? I tried that with no success on an empty project with Firebase + AdMob with no success on the builds :(

With just Firebase or just AdMob it builds fine. But as soon as you have both assets in the project it fails to build with this conflict.

@dczlonka
Copy link

I have the same issue. Cleaning Library didn't help. I also tried this: firebase unity fix but it didn't help. It only caused new error:
AAPT: error: resource style/BaseUnityGameActivityTheme

@playjoa
Copy link
Author

playjoa commented Oct 24, 2024

I have the same issue. Cleaning Library didn't help. I also tried this: firebase unity fix but it didn't help. It only caused new error: AAPT: error: resource style/BaseUnityGameActivityTheme

Yeah, same for me. Just could not make it work by editing the Manifest. I also noticed the last official google sign in (from years ago) also stopped working in builds in Unity 6. It seems that there are some forked versions from some folks that worked. But do keep in mind that the vanilla sign in is not working from scratch also.

@rmtrvuz
Copy link

rmtrvuz commented Oct 25, 2024

Editing the manifest fixed the problem for me. I also encountered the same issue in a non-Unity project. Fixed it the same way. It seems to be an old problem (since around February 2024) that occurs when using AGP > 8.3.0 with Firebase and AdMob.

@fiusmx
Copy link

fiusmx commented Nov 4, 2024

Any news on a solution for compatibility with Unity 6.000.2x? I have a similar issue and am only using the AdMob SDK. I tried with versions 9.2.1 and earlier, and the latest 9.3.0 doesn’t work either in Unity 6.000.2x; it returns a 'Gradle Failure' error. I’ve been waiting for several days for a potential 9.3.1 version update to fix this in Unity6-Android. Is there any temporary solution or alternative available until this version is updated?

@mrongoz
Copy link

mrongoz commented Nov 4, 2024

for now im use in Manifest.xml , in Publishing Setting Check Custom Main Mannifest and Use Like This

<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">
    <application>
        <!--Used when Application Entry is set to Activity, otherwise remove this activity block-->
        <activity android:name="com.unity3d.player.UnityPlayerActivity"
                  android:theme="@style/UnityThemeSelector">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
        </activity>
		<property
        android:name="android.adservices.AD_SERVICES_CONFIG"
        android:resource="@xml/gma_ad_services_config"
        tools:replace="android:resource" />
		
    </application>
</manifest>


This Working For Now, But i dont know this safe or not for Admob

@vinkini
Copy link
Collaborator

vinkini commented Nov 4, 2024

If you are seeing the error that the property android.adservices.AD_SERVICES_CONFIG is being added by two libraries, Google Mobile Ads Plugin has an option to enable us to strip this property from the play-services-ads-lite library. This can be toggled by going to Assets > Google Mobile Ads > Settings > Remove property tag from GMA Android SDK > Enabled.
Screenshot 2024-11-04 at 12 14 44 AM

I hope this removes the error while we pursue a fix on the SDK.

@fiusmx
Copy link

fiusmx commented Nov 5, 2024

If you are seeing the error that the property android.adservices.AD_SERVICES_CONFIG is being added by two libraries, Google Mobile Ads Plugin has an option to enable us to strip this property from the play-services-ads-lite library. This can be toggled by going to Assets > Google Mobile Ads > Settings > Remove property tag from GMA Android SDK > Enabled. Screenshot 2024-11-04 at 12 14 44 AM

I hope this removes the error while we pursue a fix on the SDK.

Working for me, Thank you!

@ashyEmmm
Copy link

ashyEmmm commented Nov 8, 2024

If you are seeing the error that the property android.adservices.AD_SERVICES_CONFIG is being added by two libraries, Google Mobile Ads Plugin has an option to enable us to strip this property from the play-services-ads-lite library. This can be toggled by going to Assets > Google Mobile Ads > Settings > Remove property tag from GMA Android SDK > Enabled. Screenshot 2024-11-04 at 12 14 44 AM

I hope this removes the error while we pursue a fix on the SDK.

My unity version: v6000.0.24f1
I set it up, but it doesn't work Until I restart Unity, if your modifications still don't work, please restart Unity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants