googlesamples/unity-jar-resolver

[Question] Android resolution fails after multiple attepts, populates large amount of incorrect versions.

nitz opened this issue · 3 comments

nitz commented

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2020.3.48f1
  • External Dependency Manager version: 1.2.178 (December 22, 2023)
  • Source you installed EDM4U: UPM
  • Features in External Dependency Manager in use: AndroidResolver
  • Plugins SDK in use: None
  • Platform you are using the Unity editor on: Windows

[REQUIRED] Please describe the question here:

The issue I'm running into seems to be somewhat similar to #591.

For my project, I need androidx.appcompat:appcompat, which depends on androidx.fragment:fragment and androidx.activity:activity, and so on.

I've recreated my issue in a standalone, empty project, uploaded here: ResolveVersionIssueRepro.zip

My *Dependencies.xml looks like:

<dependencies>
  <androidPackages>
    <repositories>
      <repository>https://dl.google.com/dl/android/maven2</repository>
      <repository>https://repo.maven.apache.org/maven2</repository>
    </repositories>
    <androidPackage spec="androidx.appcompat:appcompat:1.6.1" />
  </androidPackages>
</dependencies>

Resolution via Force (or if auto is enabled) eventually fails after 19+ attempts.

The first attempt fails, including some of the following output:

Resolution attempt 1: packages [androidx.appcompat:appcompat:1.6.1]
androidx.activity:activity conflicting due to package(s):
- androidx.appcompat:appcompat:1.6.1/androidx.activity:activity:1.6.0
- androidx.appcompat:appcompat:1.6.1/androidx.fragment:fragment:1.3.6/androidx.activity:activity:1.2.4
androidx.core:core conflicting due to package(s):
<snipped>

The final attempt fails, including this particular message, after it executes several 'copy' tasks.

* What went wrong:
Execution failed for task ':process_androidx.activity.activity-1.9.0-alpha01.aar'.
> Unsupported class file major version 61

The conclusion of attempting to resolve is an Assets/Plugins/Android folder filled with lots of libraries, but noticeably almost all pre-release. As well, the package I wanted specifically (named in the config xml) is there, but the wrong version, and as well ends up with some of it's dependencies completely missing regardless of version. (Note that androidx.activity:activity isn't present.)

image

The end result of all this is that my plugin isn't able to find and use the classes it needs.

I may very well be missing something through all of this, but it seems quite unintended that EDM4U would go on a wild goose chase as it does in this regard.

Cheers!

This issue does not seem to follow the issue template. Make sure you provide all the required information.

nitz commented

This issue does not seem to follow the issue template. Make sure you provide all the required information.

I believe you are mistaken, mr. bot.

Hi @nitz,

The solution for the ticket you mentioned involves enabling both Custom Main Gradle Template and Custom Gradle Properties Template from your Player Settings > Publishing Settings. The generated files can handle the resolution better than the custom script in the resolver.

Let me know if an issue arisses with this solution so this ticket can be reopened.