skip to Main Content

I am using Unity Editor version 2022.3.21f1 version
Even in blank project after installing Google Mobile Ads Unity Plugin v9.0.0 and setting the google mobile ads id it throws an error while building an Apk file but if I don’t install the google ads then any project builds fine.

The 3 error (in sequence) that is occurring is given below:
Error 1:

Exception while marshalling C:Program FilesUnityHubEditor2022.3.21f1EditorDataPlaybackEnginesAndroidPlayerSDKbuild-tools32.0.0package.xml. Probably the SDK is read-only
Exception while marshalling C:Program FilesUnityHubEditor2022.3.21f1EditorDataPlaybackEnginesAndroidPlayerSDKplatform-toolspackage.xml. Probably the SDK is read-only
Exception while marshalling C:Program FilesUnityHubEditor2022.3.21f1EditorDataPlaybackEnginesAndroidPlayerSDKplatformsandroid-31package.xml. Probably the SDK is read-only
Exception while marshalling C:Program FilesUnityHubEditor2022.3.21f1EditorDataPlaybackEnginesAndroidPlayerSDKplatformsandroid-32package.xml. Probably the SDK is read-only
Exception while marshalling C:Program FilesUnityHubEditor2022.3.21f1EditorDataPlaybackEnginesAndroidPlayerSDKtoolspackage.xml. Probably the SDK is read-only

--Some list of tasks--
90 actionable tasks: 90 executed

UnityEditor.GenericMenu:CatchMenu (object,string[],int)

Error 2:

Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
Note: C:UsersSAHIL CHOUHANUNITYTap-CounterLibraryBeeAndroidPrjMono2xGradleunityLibrarysrcmainjavacomunity3dplayerUnityPlayerActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':launcher:processReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
   > Android resource linking failed
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:11: AAPT: error: attribute layout_constraintEnd_toEndOf (aka com.sahilchouhandev.tapcounter:layout_constraintEnd_toEndOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:11: AAPT: error: attribute layout_constraintStart_toStartOf (aka com.sahilchouhandev.tapcounter:layout_constraintStart_toStartOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:11: AAPT: error: attribute layout_constraintTop_toTopOf (aka com.sahilchouhandev.tapcounter:layout_constraintTop_toTopOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:11: AAPT: error: attribute layout_constraintBottom_toBottomOf (aka com.sahilchouhandev.tapcounter:layout_constraintBottom_toBottomOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:23: AAPT: error: attribute layout_constraintEnd_toEndOf (aka com.sahilchouhandev.tapcounter:layout_constraintEnd_toEndOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:23: AAPT: error: attribute layout_constraintStart_toStartOf (aka com.sahilchouhandev.tapcounter:layout_constraintStart_toStartOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:23: AAPT: error: attribute layout_constraintTop_toTopOf (aka com.sahilchouhandev.tapcounter:layout_constraintTop_toTopOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:23: AAPT: error: attribute layout_constraintBottom_toTopOf (aka com.sahilchouhandev.tapcounter:layout_constraintBottom_toTopOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:35: AAPT: error: attribute layout_constraintEnd_toEndOf (aka com.sahilchouhandev.tapcounter:layout_constraintEnd_toEndOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:35: AAPT: error: attribute layout_constraintStart_toStartOf (aka com.sahilchouhandev.tapcounter:layout_constraintStart_toStartOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:35: AAPT: error: attribute layout_constraintTop_toBottomOf (aka com.sahilchouhandev.tapcounter:layout_constraintTop_toBottomOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:35: AAPT: error: attribute layout_constraintBottom_toTopOf (aka com.sahilchouhandev.tapcounter:layout_constraintBottom_toTopOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:45: AAPT: error: attribute layout_constraintEnd_toEndOf (aka com.sahilchouhandev.tapcounter:layout_constraintEnd_toEndOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:45: AAPT: error: attribute layout_constraintStart_toStartOf (aka com.sahilchouhandev.tapcounter:layout_constraintStart_toStartOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:45: AAPT: error: attribute layout_constraintTop_toTopOf (aka com.sahilchouhandev.tapcounter:layout_constraintTop_toTopOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:45: AAPT: error: attribute layout_constraintBottom_toBottomOf (aka com.sahilchouhandev.tapcounter:layout_constraintBottom_toBottomOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:55: AAPT: error: attribute layout_constraintDimensionRatio (aka com.sahilchouhandev.tapcounter:layout_constraintDimensionRatio) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:55: AAPT: error: attribute layout_constraintStart_toStartOf (aka com.sahilchouhandev.tapcounter:layout_constraintStart_toStartOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:55: AAPT: error: attribute layout_constraintTop_toTopOf (aka com.sahilchouhandev.tapcounter:layout_constraintTop_toTopOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:55: AAPT: error: attribute layout_constraintBottom_toBottomOf (aka com.sahilchouhandev.tapcounter:layout_constraintBottom_toBottomOf) not found.
         

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

UnityEditor.GenericMenu:CatchMenu (object,string[],int)

Error 3:

CommandInvokationFailure: Gradle build failed. 
C:Program FilesUnityHubEditor2022.3.21f1EditorDataPlaybackEnginesAndroidPlayerOpenJDKbinjava.exe -classpath "C:Program FilesUnityHubEditor2022.3.21f1EditorDataPlaybackEnginesAndroidPlayerToolsgradlelibgradle-launcher-7.2.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"

Environment Variables:
PROCESSOR_ARCHITECTURE = AMD64
AMPLITUDE_API_KEY_YELLOWBUCKET_DEV = 48835b4d1f5e342aefe5f016324d296a
BURST_ANDROID_MIN_API_LEVEL = 22
DriverData = C:WindowsSystem32DriversDriverData
USERDOMAIN = LAPTOP-9BFAR1AL
CommonProgramFiles(x86) = C:Program Files (x86)Common Files
COMPUTERNAME = LAPTOP-9BFAR1AL
DEBUG_ENV_VAR = UnityHub
LOGONSERVER = \LAPTOP-9BFAR1AL
AMPLITUDE_TOKEN_GREENBUCKET_PROD = yyzPzalJDwrQcYNuOZam0bhKb26WyyhK
PUBLIC = C:UsersPublic
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 FilesUnityHubEditor2022.3.21f1EditorDataPlaybackEnginesAndroidPlayerNDK
PROCESSOR_IDENTIFIER = Intel64 Family 6 Model 154 Stepping 3, GenuineIntel
HEAP_CLIENT_TOKEN_STAGING = 3786794399
HOMEPATH = UsersSAHIL CHOUHAN
AMPLITUDE_TOKEN_REDBUCKET_DEV = U4PSN7S7PuYVRODivvdcFwbu8R6IHGqa
CHROME_CRASHPAD_PIPE_NAME = \.pipecrashpad_12164_GFBLPPPZWXVSOWVA
PROCESSOR_LEVEL = 6
JAVA_TOOL_OPTIONS = -Dfile.encoding=UTF-8
CommonProgramFiles = C:Program FilesCommon Files
ZES_ENABLE_SYSMAN = 1
JAVA_HOME = C:Program FilesUnityHubEditor2022.3.21f1EditorDataPlaybackEnginesAndroidPlayerOpenJDK
USERDOMAIN_ROAMINGPROFILE = LAPTOP-9BFAR1AL
TEMP = C:UsersSAHILC~1AppDataLocalTemp
CommonProgramW6432 = C:Program FilesCommon Files
EFC_15304 = 1
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 = SAHIL CHOUHAN
OneDrive = C:UsersSAHIL CHOUHANOneDrive
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 = 16
VBOX_MSI_INSTALL_PATH = C:Program FilesOracleVirtualBox
AMPLITUDE_TOKEN_GREENBUCKET_DEV = 84H2gMm_FJzhr3mBaX1lM1JVukmCM7d9
AMPLITUDE_DEPLOYMENT_KEY_RED_BUCKET_DEV = client-wbjHYrmeSR87GmWOE7LDpf7sUySOIKHm
PSModulePath = C:Program FilesWindowsPowerShellModules;C:Windowssystem32WindowsPowerShellv1.0Modules
AMPLITUDE_API_KEY_GREENBUCKET_PROD = c86fea37a9e1d3f0878b96e15b111c7c
ComSpec = C:Windowssystem32cmd.exe
ORIGINAL_XDG_CURRENT_DESKTOP = undefined
IntelliJ IDEA Community Edition = C:Program FilesJetBrainsIntelliJ IDEA Community Edition 2023.2.3bin;
PROCESSOR_REVISION = 9a03
AMPLITUDE_DEPLOYMENT_KEY_RED_BUCKET_PROD = client-zH8Y7OK1i331EKuG77C6UxN8ygcM6LzS
TMP = C:UsersSAHILC~1AppDataLocalTemp
SystemDrive = C:
AMPLITUDE_API_KEY = 28f3cae0b33b8b3702120c9ed1a935aa
OneDriveConsumer = C:UsersSAHIL CHOUHANOneDrive
SENTRY_ACCESS_TOKEN = 3df78d9e53f8456aa90fbae044ce1a6261421ab1d0014674bc2e933477289017
HEAP_CLIENT_TOKEN = 1717415662
APPDATA = C:UsersSAHIL CHOUHANAppDataRoaming
Path = C:Program FilesCommon FilesOracleJavajavapath;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:WindowsSystem32OpenSSH;C:Program Files (x86)NVIDIA CorporationPhysXCommon;C:Program FilesNVIDIA CorporationNVIDIA NvDLISR;C:Program Filesnodejs;C:Program FilesGitcmd;C:Program FilesRedis;C:Program Files (x86)Windows Kits10Windows Performance Toolkit;C:Program Filesdotnet;C:UsersSAHIL CHOUHANAppDataLocalMicrosoftWindowsApps;;C:UsersSAHIL CHOUHANAppDataLocalProgramsMicrosoft VS Codebin;C:UsersSAHIL CHOUHANAppDataRoamingnpm;C:UsersSAHIL CHOUHANAppDataLocalProgramsmongosh;C:Program Files (x86)MongoDB CLI;C:Program FilesJetBrainsIntelliJ IDEA Community Edition 2023.2.3bin;;C:UsersSAHIL CHOUHAN.dotnettools
ProgramFiles = C:Program Files
LOCALAPPDATA = C:UsersSAHIL CHOUHANAppDataLocal
USERPROFILE = C:UsersSAHIL CHOUHAN
WOOTRIC_CLIENT_TOKEN = NPS-aa8be4c3


stderr[
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
Note: C:UsersSAHIL CHOUHANUNITYTap-CounterLibraryBeeAndroidPrjMono2xGradleunityLibrarysrcmainjavacomunity3dplayerUnityPlayerActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':launcher:processReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
   > Android resource linking failed
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:11: AAPT: error: attribute layout_constraintEnd_toEndOf (aka com.sahilchouhandev.tapcounter:layout_constraintEnd_toEndOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:11: AAPT: error: attribute layout_constraintStart_toStartOf (aka com.sahilchouhandev.tapcounter:layout_constraintStart_toStartOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:11: AAPT: error: attribute layout_constraintTop_toTopOf (aka com.sahilchouhandev.tapcounter:layout_constraintTop_toTopOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:11: AAPT: error: attribute layout_constraintBottom_toBottomOf (aka com.sahilchouhandev.tapcounter:layout_constraintBottom_toBottomOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:23: AAPT: error: attribute layout_constraintEnd_toEndOf (aka com.sahilchouhandev.tapcounter:layout_constraintEnd_toEndOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:23: AAPT: error: attribute layout_constraintStart_toStartOf (aka com.sahilchouhandev.tapcounter:layout_constraintStart_toStartOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:23: AAPT: error: attribute layout_constraintTop_toTopOf (aka com.sahilchouhandev.tapcounter:layout_constraintTop_toTopOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:23: AAPT: error: attribute layout_constraintBottom_toTopOf (aka com.sahilchouhandev.tapcounter:layout_constraintBottom_toTopOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:35: AAPT: error: attribute layout_constraintEnd_toEndOf (aka com.sahilchouhandev.tapcounter:layout_constraintEnd_toEndOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:35: AAPT: error: attribute layout_constraintStart_toStartOf (aka com.sahilchouhandev.tapcounter:layout_constraintStart_toStartOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:35: AAPT: error: attribute layout_constraintTop_toBottomOf (aka com.sahilchouhandev.tapcounter:layout_constraintTop_toBottomOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:35: AAPT: error: attribute layout_constraintBottom_toTopOf (aka com.sahilchouhandev.tapcounter:layout_constraintBottom_toTopOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:45: AAPT: error: attribute layout_constraintEnd_toEndOf (aka com.sahilchouhandev.tapcounter:layout_constraintEnd_toEndOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:45: AAPT: error: attribute layout_constraintStart_toStartOf (aka com.sahilchouhandev.tapcounter:layout_constraintStart_toStartOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:45: AAPT: error: attribute layout_constraintTop_toTopOf (aka com.sahilchouhandev.tapcounter:layout_constraintTop_toTopOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:45: AAPT: error: attribute layout_constraintBottom_toBottomOf (aka com.sahilchouhandev.tapcounter:layout_constraintBottom_toBottomOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:55: AAPT: error: attribute layout_constraintDimensionRatio (aka com.sahilchouhandev.tapcounter:layout_constraintDimensionRatio) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:55: AAPT: error: attribute layout_constraintStart_toStartOf (aka com.sahilchouhandev.tapcounter:layout_constraintStart_toStartOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:55: AAPT: error: attribute layout_constraintTop_toTopOf (aka com.sahilchouhandev.tapcounter:layout_constraintTop_toTopOf) not found.
         
     ERROR:C:UsersSAHIL CHOUHAN.gradlecachestransforms-31da722fe6afea6bb529fa775ba4e2364transformedjetified-googlemobileads-unityreslayoutgnt_medium_template_view.xml:55: AAPT: error: attribute layout_constraintBottom_toBottomOf (aka com.sahilchouhandev.tapcounter:layout_constraintBottom_toBottomOf) not found.
         

* 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 7s
]
stdout[
Exception while marshalling C:Program FilesUnityHubEditor2022.3.21f1EditorDataPlaybackEnginesAndroidPlayerSDKbuild-tools32.0.0package.xml. Probably the SDK is read-only
Exception while marshalling C:Program FilesUnityHubEditor2022.3.21f1EditorDataPlaybackEnginesAndroidPlayerSDKplatform-toolspackage.xml. Probably the SDK is read-only
Exception while marshalling C:Program FilesUnityHubEditor2022.3.21f1EditorDataPlaybackEnginesAndroidPlayerSDKplatformsandroid-31package.xml. Probably the SDK is read-only
Exception while marshalling C:Program FilesUnityHubEditor2022.3.21f1EditorDataPlaybackEnginesAndroidPlayerSDKplatformsandroid-32package.xml. Probably the SDK is read-only
Exception while marshalling C:Program FilesUnityHubEditor2022.3.21f1EditorDataPlaybackEnginesAndroidPlayerSDKtoolspackage.xml. Probably the SDK is read-only

I have tried searching internet for solution, unluckily I didn’t find any working cause they are all for older versions of Google Mobile Ads Unity Plugin.
While debugging I realised that there is some problem with Google Mobile Ads Unity Plugin v9.0.0 because if I donot use it in the project it will work fine but as soon I install it without even using it given the above errors.

Plx help me to fix this problem —

2

Answers


  1. I had the same issue using Unity 2021/2022 and Admob 9.0.0, and this worked for me. Add this dependency to your gradle.build file:

    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    

    You need to enable AndroidX in your gradleTemplate.properties file by adding this line:

    android.useAndroidX=true
    

    I found the answer here: How to fix this > attribute app:constraintBottom_toBottomOf not found

    Hope it works for you as well.

    Login or Signup to reply.
  2. Ok, so for some reason this is fixed, by adding

        implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    

    To MainTemplate.gradle file under dependencies.

    Why this needs a manual include i do not know. The package has a manifest that implies it should be included, yet it fails to do so in old Unity versions. I tried everything from upgrading gradle version etc. It most certainly is an issue within Unity. But i can’t pinpoint what it is.
    If you were to use "force resolve" in the android dependency resolved menu, it would also work, for 1 build until it deletes itself again.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search