Closed kushG closed 4 months ago
I was getting a similar problem. There are 2 solutions:
I also have the same problem, any idea how to solve it?
You can easily fix this issue by adding these lines to your mainTemplate.gradle:
gradle.projectsEvaluated {
apply from: 'GoogleMobileAdsPlugin.androidlib/validate_dependencies.gradle'
}
This should be included in GoogleMobileAds v 8.6.0
.
You may also try clearing your gradle cache.
This should be included in GoogleMobileAds v
8.6.0
.You may also try clearing your gradle cache.
Got the same issue when implemented Google Admob version 8.6.0 and com.google.android.gms:play-services-ads:22.5.0 on Unity 2021.3.18. Any way to fix it
You can easily fix this issue by adding these lines to your mainTemplate.gradle:
gradle.projectsEvaluated { apply from: 'GoogleMobileAdsPlugin.androidlib/validate_dependencies.gradle' }
this is work for me, thanks a lot <3
You can easily fix this issue by adding these lines to your mainTemplate.gradle:
gradle.projectsEvaluated { apply from: 'GoogleMobileAdsPlugin.androidlib/validate_dependencies.gradle' }
Thank You o great wizard this fixed the problem
This should be included in GoogleMobileAds v
8.6.0
. You may also try clearing your gradle cache.Got the same issue when implemented Google Admob version 8.6.0 and com.google.android.gms:play-services-ads:22.5.0 on Unity 2021.3.18. Any way to fix it
I'm also facing same issue. Any update ? Not using custom mainTempate.gradle
Google Mobile Ads Unity plugin version: 8.6.0
+1 get this issue. This fix does not help me. Sometimes it lets me to make one build and then stops me from building again with that error.
You can easily fix this issue by adding these lines to your mainTemplate.gradle:
gradle.projectsEvaluated { apply from: 'GoogleMobileAdsPlugin.androidlib/validate_dependencies.gradle' }
Unity 2021.3.29f1
UPD: It lets me build once when I change gradle to external or back to internal
I'm having this issue as well. Unity 2021.3.27f1 Google Mobile Ads Unity 8.6.0
You can easily fix this issue by adding these lines to your mainTemplate.gradle:
gradle.projectsEvaluated { apply from: 'GoogleMobileAdsPlugin.androidlib/validate_dependencies.gradle' }
I can't update the mainTemplate.gradle as its currently disabled for me as i use a custom gradleTemplate. Is there something i need to do to replicate the same thing in this scenario?
Hi,
We are looking into this issue.
You can easily fix this issue by adding these lines to your mainTemplate.gradle:
gradle.projectsEvaluated { apply from: 'GoogleMobileAdsPlugin.androidlib/validate_dependencies.gradle' }
OMG thanks you so much. It works for me.
After this workaround I still have this errors in console: `stderr[ Note: E:\xxx\xxx\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.
What went wrong: Execution failed for task ':launcher:processReleaseResources'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade AAPT2 aapt2-4.0.1-6197926-windows Daemon #1: Unexpected error during link, attempting to stop daemon. This should not happen under normal circumstances, please file an issue if it does.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade AAPT2 aapt2-4.0.1-6197926-windows Daemon #0: Unexpected error during link, attempting to stop daemon. This should not happen under normal circumstances, please file an issue if it does.`
Can you help me to fix them? Unity 2021. Unity 2022 fix the issues, but it's not an option.
Hi everyone,
Confirming this is an issue and we are looking into a fix.
I managed to solve the issue by upgrading unity to 2022.3. See Google documentation
You can easily fix this issue by adding these lines to your mainTemplate.gradle:
gradle.projectsEvaluated { apply from: 'GoogleMobileAdsPlugin.androidlib/validate_dependencies.gradle' }
He is a magician
You can easily fix this issue by adding these lines to your mainTemplate.gradle:
gradle.projectsEvaluated { apply from: 'GoogleMobileAdsPlugin.androidlib/validate_dependencies.gradle' }
Thank you so much, it took me 3 days to fix it
@NVentimiglia it isn't fixed. I have the same issue with the proposed workaround: `FAILURE: Build failed with an exception.
Where: Script 'E:\UnityProjects\project\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\GoogleMobileAdsPlugin.androidlib\validate_dependencies.gradle' line: 23
What went wrong: A problem occurred evaluating script.
Cannot change dependencies of dependency configuration ':unityLibrary:aarArtifacts' after it has been resolved.`
Unity 2021.3.34 Target API Level 34 - gives error upon build. Target API Level 33 - builds w/o errors.
You can easily fix this issue by adding these lines to your mainTemplate.gradle:
gradle.projectsEvaluated { apply from: 'GoogleMobileAdsPlugin.androidlib/validate_dependencies.gradle' }
Where?? I'm anxious seeing so many people get their issue solved by adding this, but I have no idea where to put this in my mainTemplate.gradle
file. Below everything? In an android
backet? In the dependencies
section? Where?? 😢
I tried in many places but the problem persists. Maybe I'm putting it in the wrong spot.
I have it here:
// Android Resolver Exclusions Start
android {
packagingOptions {
...
}
}
// GMA
gradle.projectsEvaluated {
apply from: 'GoogleMobileAdsPlugin.androidlib/validate_dependencies.gradle'
}
// Android Resolver Exclusions End
android {
compileSdkVersion **APIVERSION**
buildToolsVersion '**BUILDTOOLS**'
...
}**REPOSITORIES**
**IL_CPP_BUILD_SETUP**
**SOURCE_BUILD_SETUP**
**EXTERNAL_SOURCES**
I'm still having this issue in the latest update :/
Unity 2021.3.33f1
gradle.projectsEvaluated { apply from: 'GoogleMobileAdsPlugin.androidlib/validate_dependencies.gradle' }
it work in google mobile ads 8.6, but in version 8.7, it can not fix. how to fix?
Unity 2020.3.48f1
Same here, the following workaround was working in 8.60 but does not work in 8.70
gradle.projectsEvaluated { apply from: 'GoogleMobileAdsPlugin.androidlib/validate_dependencies.gradle' }
I had same problem as you guys and fixed it by steps below:
Unity version is 2021.3.26f1 GoogleMobileAds 8.7 Chartboost mediation 9.6.0. Min Api android 22 (5.1) Target API 34
Follow google document linked below like this: https://developers.google.com/admob/unity/gradle
1- download gradle version 6.7.1 binary file here: https://gradle.org/next-steps/?version=6.7.1&format=bin
2- Extract it anywhere and make unity use this one instead of default gradle installed with the editor.
3- In android player settings check custom "base" gradle template and not "main" gradle temple nor custom gradle properties.
4- Open the Assets/Plugins/Android/baseProjectTemplate.gradle file and set the dependencies to use Gradle build tools 4.2.0.
buildscript { dependencies { classpath 'com.android.tools.build:gradle:4.2.0' **BUILD_SCRIPT_DEPS** } }
5- Force resolve your project using External dependency manager 1.2.177 and it should resolve successfully.
6- Make sure to check Use R8 in minify code section if needed and to not check release which causes other errors.
7- lastly from build menu press clean build which is under build button itself.
Hope this helps.
Thank you @AlirezaTabasi7, it works. Unity 2020.3.48f1 Plugin 8.7.0 Api level min 21 Target 33 It didn't work until I unchecked custom main gradle temple and custom gradle properties I don't use R8 minify, if I do the app shows only a black screen on my tablet (android 6.0)
I was getting this error after updating from a very old version of Unity Google Mobile Ads to 8.7.0.
I fixed it by deleting the Assets\GoogleMobileAds\
folder and deleting all the googlemobileads files and folders (upper and lower case) in \Assets\Plugins\Android
.
I then reinstalled the 8.7.0 package, force resolved all Android dependencies, and Android builds succeeded again.
Perhaps some old Google Ads settings or files from prior versions were still in the project and were breaking the build, but this fixed it for me.
You can easily fix this issue by adding these lines to your mainTemplate.gradle:
gradle.projectsEvaluated { apply from: 'GoogleMobileAdsPlugin.androidlib/validate_dependencies.gradle' }
Worked like a charm, but only after downgrading to 8.6.0. Couldn`t make 8.7.0 work...
https://github.com/googleads/googleads-mobile-unity/issues/3042#issuecomment-1919833720 I updated the android sdk to 34 and solved the problem with this
[REQUIRED] Step 1: Describe your environment
[REQUIRED] Step 2: Describe the problem
Steps to reproduce:
When targeting API 34 in Unity, I'm seeing the the following error while making a build. I have enabled both the options as mentioned here https://github.com/googleads/googleads-mobile-unity/issues/2930#issuecomment-1817271448