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

A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction #3048

Closed
rounddroid opened this issue Dec 1, 2023 · 21 comments
Assignees

Comments

@rounddroid
Copy link

rounddroid commented Dec 1, 2023

[REQUIRED] Step 1: Describe your environment

  • Unity version: 2022.3.14
  • Google Mobile Ads Unity plugin version: 8.6.0
  • Platform: Unity Editor
  • Platform OS version: Windows 10
  • Any specific devices issue occurs on: -
  • Mediation ad networks used, and their versions: none

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

  • Create a blank Unity Project (2D template tested)
  • Import GoogleMobileAds-v8.6.0.unitypackage
  • Let External Dependency Manager to resolve dependencies
  • Switch target platform to Android
  • In menu Assets, Google Mobile Ads, Settings set an app id
  • In Build Settings enable Build App Bundle (Google Play)
  • In Player Settings assign a package name
  • Minimum API level 23, target API level 34
  • Build

The build fails with the popup "A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction".

Sample project:

Testadmob.zip

testadmob

@NVentimiglia
Copy link
Member

@rounddroid

Can you provide any additional logs for this issue? The console logs and Unity Editor Logs would be ideal.

@NVentimiglia NVentimiglia self-assigned this Dec 4, 2023
@vivaan6s9
Copy link

Hi, i was having the same issue with admob 8.6.0 and same environment. reverting back to older admob version solved the issue.

The error log is -

Execution failed for task ':unityLibrary:mergeReleaseJavaResource'.

A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
2 files found with path 'META-INF/kotlinx_coroutines_core.version' from inputs:

@Nexus-49
Copy link

Nexus-49 commented Dec 7, 2023

I solved this problem by downgrading version of ADMOB and i used AdMob v8.5.. This AdMob v8.6 is having issues and not creating build.

@Hafeez2200
Copy link

How can I downgrade my ADMOB to v8.5 i am having the same issue while building

@NVentimiglia
Copy link
Member

Thanks for reporting this,

We are looking into this issue.

@rounddroid
Copy link
Author

rounddroid commented Dec 12, 2023

@rounddroid

Can you provide any additional logs for this issue? The console logs and Unity Editor Logs would be ideal.

Tested in 2022.3.15f1 with the same result. Here are some logs.


Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':unityLibrary:mergeReleaseJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
   > 2 files found with path 'META-INF/kotlinx_coroutines_core.version' from inputs:
      - C:\Users\round\Testadmob\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\libs\org.jetbrains.kotlinx.kotlinx-coroutines-core-1.7.1.jar
      - C:\Users\round\Testadmob\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\libs\org.jetbrains.kotlinx.kotlinx-coroutines-core-jvm-1.7.1.jar
     Adding a packagingOptions block may help, please refer to
     https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.PackagingOptions.html
     for more information

* 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 18s

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

CommandInvokationFailure: Gradle build failed. 
C:\Program Files\Unity\Hub\Editor\2022.3.15f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2022.3.15f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-7.2.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

Environment Variables:
PROCESSOR_ARCHITECTURE = AMD64
JAVA_HOME = C:\Program Files\Unity\Hub\Editor\2022.3.15f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK
BURST_ANDROID_MIN_API_LEVEL = 22
DriverData = C:\Windows\System32\Drivers\DriverData
LAUNCH_DARKLY_CLIENT_TOKEN = 60a7e30fafc7e60e33446283
CommonProgramFiles(x86) = C:\Program Files (x86)\Common Files
COMPUTERNAME = DESKTOP-IMSOGGK
DEBUG_ENV_VAR = UnityHub
LOGONSERVER = \\DESKTOP-IMSOGGK
AMPLITUDE_TOKEN_GREENBUCKET_PROD = yyzPzalJDwrQcYNuOZam0bhKb26WyyhK
AMPLITUDE_API_KEY_YELLOWBUCKET_DEV = 48835b4d1f5e342aefe5f016324d296a
ProgramData = C:\ProgramData
SESSIONNAME = Console
AMPLITUDE_TOKEN_YELLOWBUCKET_PROD = Ph-837Q6GNodAkyc2MRkxVPUcjlIET4d
ALLUSERSPROFILE = C:\ProgramData
SystemRoot = C:\Windows
windir = C:\Windows
AMPLITUDE_API_KEY_REDBUCKET_DEV = 46b8b46515e7632fc42a504b72e05fd0
ProgramFiles(x86) = C:\Program Files (x86)
ProgramW6432 = C:\Program Files
OS = Windows_NT
ANDROID_NDK_ROOT = C:\Program Files\Unity\Hub\Editor\2022.3.15f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK
PROCESSOR_IDENTIFIER = AMD64 Family 23 Model 113 Stepping 0, AuthenticAMD
HEAP_CLIENT_TOKEN_STAGING = 3786794399
HOMEPATH = \Users\round
AMPLITUDE_TOKEN_REDBUCKET_DEV = U4PSN7S7PuYVRODivvdcFwbu8R6IHGqa
CHROME_CRASHPAD_PIPE_NAME = \\.\pipe\crashpad_2528_IUGWFCXXKOMMXZEQ
PROCESSOR_LEVEL = 23
JAVA_TOOL_OPTIONS = -Dfile.encoding=UTF-8
CommonProgramFiles = C:\Program Files\Common Files
PUBLIC = C:\Users\Public
USERDOMAIN_ROAMINGPROFILE = DESKTOP-IMSOGGK
TEMP = C:\Users\round\AppData\Local\Temp
CommonProgramW6432 = C:\Program Files\Common Files
AMPLITUDE_TOKEN_YELLOWBUCKET_DEV = wKi8foVigDditGFvmZewRFWsEbX9Y0YO
AMPLITUDE_API_KEY_GREENBUCKET_DEV = 3ded2a762163603391a425f688f990c8
AMPLITUDE_API_KEY_REDBUCKET_PROD = ca12bb461ea96f9bdf5df4ded7d52994
HOMEDRIVE = C:
AMPLITUDE_API_KEY_STAGING = 83ee04fccc67e4fcc7dd527c4c6f1e21
USERNAME = round
OneDrive = C:\Users\round\OneDrive
AMPLITUDE_API_KEY_YELLOWBUCKET_PROD = e03a9bbe92dc38a88cdb068d24c65b46
PATHEXT = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
AMPLITUDE_TOKEN_REDBUCKET_PROD = QqyoFpcWPi7V17p80_46CF6-sNGRGbHo
NUMBER_OF_PROCESSORS = 12
LAUNCH_DARKLY_CLIENT_TOKEN_STAGING = 60a7e30fafc7e60e33446282
AMPLITUDE_TOKEN_GREENBUCKET_DEV = 84H2gMm_FJzhr3mBaX1lM1JVukmCM7d9
ProgramFiles = C:\Program Files
AMPLITUDE_API_KEY_GREENBUCKET_PROD = c86fea37a9e1d3f0878b96e15b111c7c
ComSpec = C:\Windows\system32\cmd.exe
ORIGINAL_XDG_CURRENT_DESKTOP = undefined
USERDOMAIN = DESKTOP-IMSOGGK
PROCESSOR_REVISION = 7100
TMP = C:\Users\round\AppData\Local\Temp
SystemDrive = C:
AMPLITUDE_API_KEY = 28f3cae0b33b8b3702120c9ed1a935aa
OneDriveConsumer = C:\Users\round\OneDrive
SENTRY_ACCESS_TOKEN = 3df78d9e53f8456aa90fbae044ce1a6261421ab1d0014674bc2e933477289017
HEAP_CLIENT_TOKEN = 1717415662
APPDATA = C:\Users\round\AppData\Roaming
Path = C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\PuTTY\;C:\Program Files\AutoFirma\AutoFirma;C:\Users\round\AppData\Local\Microsoft\WindowsApps;
PSModulePath = C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
LOCALAPPDATA = C:\Users\round\AppData\Local
USERPROFILE = C:\Users\round
WOOTRIC_CLIENT_TOKEN = NPS-aa8be4c3


stderr[
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':unityLibrary:mergeReleaseJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
   > 2 files found with path 'META-INF/kotlinx_coroutines_core.version' from inputs:
      - C:\Users\round\Testadmob\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\libs\org.jetbrains.kotlinx.kotlinx-coroutines-core-1.7.1.jar
      - C:\Users\round\Testadmob\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\libs\org.jetbrains.kotlinx.kotlinx-coroutines-core-jvm-1.7.1.jar
     Adding a packagingOptions block may help, please refer to
     https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.PackagingOptions.html
     for more information

* 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 18s
]
stdout[
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 34

This Android Gradle plugin (7.1.2) was tested up to compileSdk = 32

This warning can be suppressed by adding
    android.suppressUnsupportedCompileSdk=34
to this project's gradle.properties

The build will continue, but you are strongly encouraged to update your project to
use a newer Android Gradle Plugin that has been tested with compileSdk = 34
> Task :unityLibrary:preBuild UP-TO-DATE
> Task :launcher:preBuild UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:preBuild UP-TO-DATE
> Task :unityLibrary:preReleaseBuild UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:preReleaseBuild UP-TO-DATE
> Task :launcher:preReleaseBuild UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:compileReleaseAidl NO-SOURCE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:packageReleaseRenderscript NO-SOURCE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:compileReleaseRenderscript NO-SOURCE
> Task :launcher:generateReleaseBuildConfig
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:generateReleaseResValues
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:generateReleaseResources
> Task :launcher:generateReleaseResValues
> Task :launcher:javaPreCompileRelease
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:packageReleaseResources
> Task :launcher:createReleaseCompatibleScreenManifests
> Task :launcher:extractDeepLinksRelease
> Task :launcher:extractProguardFiles
> Task :launcher:mergeReleaseJniLibFolders
> Task :unityLibrary:mergeReleaseJniLibFolders
> Task :unityLibrary:compileReleaseAidl NO-SOURCE
> Task :unityLibrary:compileReleaseRenderscript NO-SOURCE
> Task :unityLibrary:generateReleaseBuildConfig
> Task :unityLibrary:generateReleaseResValues
> Task :unityLibrary:generateReleaseResources
> Task :unityLibrary:packageReleaseResources
> Task :unityLibrary:mergeReleaseNativeLibs
> Task :launcher:compileReleaseAidl NO-SOURCE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:generateReleaseBuildConfig
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:javaPreCompileRelease
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:mergeReleaseJniLibFolders
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:mergeReleaseNativeLibs NO-SOURCE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:stripReleaseDebugSymbols NO-SOURCE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:copyReleaseJniLibsProjectAndLocalJars
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:parseReleaseLocalResources
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:mergeReleaseShaders
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:compileReleaseShaders NO-SOURCE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:generateReleaseAssets UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:packageReleaseAssets
> Task :unityLibrary:parseReleaseLocalResources
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:prepareLintJarForPublish
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:prepareReleaseArtProfile
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:processReleaseJavaRes NO-SOURCE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:extractDeepLinksRelease
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:writeReleaseAarMetadata
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:compileReleaseLibraryResources
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:bundleLibResRelease NO-SOURCE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:writeReleaseLintModelMetadata
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:copyReleaseJniLibsProjectOnly
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:processReleaseManifest
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:mergeReleaseJavaResource
> Task :unityLibrary:stripReleaseDebugSymbols
> Task :launcher:checkReleaseDuplicateClasses
> Task :unityLibrary:javaPreCompileRelease
> Task :unityLibrary:mergeReleaseShaders
> Task :unityLibrary:compileReleaseShaders NO-SOURCE
> Task :unityLibrary:generateReleaseAssets UP-TO-DATE
> Task :unityLibrary:processReleaseManifest
> Task :unityLibrary:copyReleaseJniLibsProjectAndLocalJars
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:generateReleaseRFile
> Task :unityLibrary:packageReleaseAssets
> Task :unityLibrary:packageReleaseRenderscript NO-SOURCE
> Task :unityLibrary:prepareLintJarForPublish
> Task :unityLibrary:prepareReleaseArtProfile
> Task :unityLibrary:processReleaseJavaRes
> Task :unityLibrary:writeReleaseAarMetadata
> Task :unityLibrary:extractDeepLinksRelease
> Task :unityLibrary:compileReleaseLibraryResources
> Task :unityLibrary:writeReleaseLintModelMetadata
> Task :unityLibrary:bundleLibResRelease
> Task :unityLibrary:copyReleaseJniLibsProjectOnly
> Task :unityLibrary:mergeReleaseJavaResource FAILED
> Task :unityLibrary:generateReleaseRFile
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:compileReleaseJavaWithJavac
> Task :launcher:desugarReleaseFileDependencies
52 actionable tasks: 52 executed
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <033353fa2720456c86cab3271f470887>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <033353fa2720456c86cab3271f470887>:0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <033353fa2720456c86cab3271f470887>:0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <033353fa2720456c86cab3271f470887>:0)
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.Action`1[T] progress) (at <033353fa2720456c86cab3271f470887>:0)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.Action`1[T] progress) (at <033353fa2720456c86cab3271f470887>:0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <033353fa2720456c86cab3271f470887>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <033353fa2720456c86cab3271f470887>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

@NVentimiglia
Copy link
Member

@rounddroid

Confirm you have updated to 8.6

This issue should be fixed with the new build options

@T-1K
Copy link

T-1K commented Jan 5, 2024

Hi @NVentimiglia similar issue, using 8.6 with default gradle on 2021.3.14f1
As your suggestion the two new options are enabled.

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':launcher:mergeReleaseJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > More than one file was found with OS independent path 'META-INF/kotlinx_coroutines_core.version'.

Publishing Settings
PublishingSettings

@kuoliangkwong
Copy link

Is there any workaround? I'm having the same issue with Unity 2022.3.14f1 and GMA 8.6.0.

@NVentimiglia
Copy link
Member

Hi everyone,

Confirming this is an issue and we are looking into a fix.

@anomal3
Copy link

anomal3 commented Jan 18, 2024

The same 2022.3.16f1

@suryaprskas
Copy link

I have the same issue in unity 2021.3.30f1
Google Mobile Ads Unity plugin version: 8.6.0
building error for google play store

@suryaprskas
Copy link

please help me

@pipe-alt
Copy link
Contributor

pipe-alt commented Jan 21, 2024

the fix was committed already 911a540

you need to wait for version 8.7.0 or download the updated scripts

@suryaprskas
Copy link

Hello I Try Google Mobile Ads Unity plugin version: 8.7.0 latest but when I try to build again building failed again what I am doing wrong please help me

Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: unexpected element (uri:"", local:"extension-level"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level>
Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level>
Note: E:\puzzle game\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • What went wrong:
    Execution failed for task ':launcher:processReleaseResources'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
C:\Users\Lenovo.gradle\caches\transforms-2\files-2.1\9d015b5fa1a3205f8bed7c0d06b26847\com.google.android.gms.play-services-ads-lite-22.6.0\AndroidManifest.xml:49:5-117: AAPT: error: unexpected element found in .

  • 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.
    ==============================================================================

2: Task failed with an exception.

  • What went wrong:
    Execution failed for task ':launcher:bundleReleaseResources'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
E:\puzzle game\Library\Bee\Android\Prj\IL2CPP\Gradle\launcher\build\intermediates\bundle_manifest\release\bundle-manifest\AndroidManifest.xml:263: AAPT: error: unexpected element found in .

  • 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.
    ====

@suryaprskas
Copy link

Screenshot (216)

@NVentimiglia
Copy link
Member

This should be fixed in the latest release 8.7

Please update. Please reopen if you run into this issue again.

@Hassan051
Copy link

Hassan051 commented Jan 24, 2024

I upgraded to version 8.7.0 but I get the same error when I build the project to abb?
I encountered this error with version 8.6.0, and on both attempts I followed Google AdMob's steps

@suryaprskas
Copy link

Hello anyone know why my Consent form is not showing in EEA and UK Countries
this is script I am using
What I am doing wrong

Please take a look

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GoogleMobileAds.Ump;
using GoogleMobileAds.Ump.Api;

public class GDPRScript : MonoBehaviour
{
ConsentForm _consentForm;
// Start is called before the first frame update
void Start()
{
var debugSettings = new ConsentDebugSettings
{
// Geography appears as in EEA for debug devices.
DebugGeography = DebugGeography.EEA,
TestDeviceHashedIds = new List
{
"965E4A26737DF85475A353251709C315"
}
};

    // Here false means users are not under age.
    ConsentRequestParameters request = new ConsentRequestParameters
    {
        TagForUnderAgeOfConsent = false,
        ConsentDebugSettings = debugSettings,
    };

    // Check the current consent information status.
    ConsentInformation.Update(request, OnConsentInfoUpdated);
}

void OnConsentInfoUpdated(FormError error)
{
    if (error != null)
    {
        // Handle the error.
        UnityEngine.Debug.LogError(error);
        return;
    }

    if (ConsentInformation.IsConsentFormAvailable())
    {
        LoadConsentForm();
    }
    // If the error is null, the consent information state was updated.
    // You are now ready to check if a form is available.
}

void LoadConsentForm()
{
    // Loads a consent form.
    ConsentForm.Load(OnLoadConsentForm);
}

void OnLoadConsentForm(ConsentForm consentForm, FormError error)
{
    if (error != null)
    {
        // Handle the error.
        UnityEngine.Debug.LogError(error);
        return;
    }

    // The consent form was loaded.
    // Save the consent form for future requests.
    _consentForm = consentForm;

    // You are now ready to show the form.
    if (ConsentInformation.ConsentStatus == ConsentStatus.Required)
    {
        _consentForm.Show(OnShowForm);
    }
}


void OnShowForm(FormError error)
{
    if (error != null)
    {
        // Handle the error.
        UnityEngine.Debug.LogError(error);
        return;
    }

    // Handle dismissal by reloading form.
    LoadConsentForm();
}

// Update is called once per frame
void Update()
{
    
}

}

@General-Monish
Copy link

General-Monish commented Jan 31, 2024

@NVentimiglia
i am facing an error while importing

Assembly 'Assets/ExternalDependencyManager/Editor/1.2.177/Google.IOSResolver.dll' will not be loaded due to errors:
Unable to resolve reference 'UnityEditor.iOS.Extensions.Xcode'. Is the assembly missing or incompatible with the current platform?
Reference validation can be disabled in the Plugin Inspector.

@MuhammadWaqasOfficial
Copy link

@NVentimiglia i am facing an error while importing

Assembly 'Assets/ExternalDependencyManager/Editor/1.2.177/Google.IOSResolver.dll' will not be loaded due to errors: Unable to resolve reference 'UnityEditor.iOS.Extensions.Xcode'. Is the assembly missing or incompatible with the current platform? Reference validation can be disabled in the Plugin Inspector.

install IOS module of unity version you're using

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