-
Notifications
You must be signed in to change notification settings - Fork 366
Description
[REQUIRED] Please fill in the following fields:
- Unity editor version: 2022.2.2f1
- External Dependency Manager version: 1.2.175
- Source you installed EDM4U: .unitypackage
- Features in External Dependency Manager in use: Android Resolver
- Plugins SDK in use: None
- Platform you are using the Unity editor on: Mac
[REQUIRED] Please describe the issue here:
(Please list the full steps to reproduce the issue. Include device logs, Unity logs, and stack traces if available.)
Steps to reproduce:
- Add Dependencies.xml which has custom
<repository>
specified. - Enable custom main gradle template and custom grade properties template.
- Run Android resolver through Assets > External Dependency Manager > Android Resolver > Resolve or Force Resolve.
Expected:
Successful build
Observed:
A lot of warnings from Gradle like that:
Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by build file 'unityLibrary/build.gradle'
And this error:
Execution failed for task ':launcher:checkReleaseDuplicateClasses'.
> Could not resolve all dependencies for configuration ':launcher:releaseRuntimeClasspath'.
The project declares repositories, effectively ignoring the repositories you have declared in the settings.
You can figure out how project repositories are declared by configuring your build to fail on project repositories.
See https://docs.gradle.org/7.2/userguide/declaring_repositories.html#sub:fail_build_on_project_repositories for details.
> Could not find com.ironsource.sdk:mediationsdk:7.2.7.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/ironsource/sdk/mediationsdk/7.2.7/mediationsdk-7.2.7.pom
- https://repo.maven.apache.org/maven2/com/ironsource/sdk/mediationsdk/7.2.7/mediationsdk-7.2.7.pom
- file:/Users/stanislavspetkevics/Desktop/unity-jar-resolver-custom-template/Library/Bee/Android/Prj/Mono2x/Gradle/unityLibrary/libs/mediationsdk-7.2.7.jar
- file:/Users/stanislavspetkevics/Desktop/unity-jar-resolver-custom-template/Library/Bee/Android/Prj/Mono2x/Gradle/unityLibrary/libs/mediationsdk.jar
Required by:
project :launcher > project :unityLibrary
You can use this project for testing: https://github.com/256p/unity-jar-resolver-custom-template.git
The reason behind this is that some time ago Unity switched to the new Android Gradle Plugin version (7.1.0). In this version repository setting was moved from the top-level build.gradle
file to the setting.gradle
(release notes: https://developer.android.com/studio/past-releases/past-agp-releases/agp-7-1-0-release-notes#settings-gradle). But EDM4U still adds project.repositories
block in the main gradle template which will not work if settings.gradle
has dependencyResolutionManagement
block.
As I see there are several possible solutions:
- Use
IPostGenerateGradleAndroidProject.OnPostGenerateGradleAndroidProject
and modify settings.gradle after every build. - Generate
settingsTemplate.gradle
automatically and add repositories there instead of the main gradle template. - Ask the user to create
settingsTemplate.gradle
and then generate a repositories list there. But Unity doesn't provide a checkbox for the settings template (which is quite odd), which means that the user will need to copy the correct template fromPlaybackEngines/AndroidPlayer/Tools/GradleTemplates/
. - Or maybe some other solution.
Please answer the following, if applicable:
What's the issue repro rate? 100%
What happened? How can we make the problem occur?
This could be a description, log/console output, etc.
If you have a downloadable sample project that reproduces the bug you're reporting, you will
likely receive a faster response on your issue.