Skip to content

[Bug] Fail to load dependencies in local repo when folder changed on Windows #661

Open
@Tbernard33

Description

@Tbernard33

[READ] For Firebase Unity SDK issues, please report to Firebase Unity Sample

Once you've read this section and determined that your issue is appropriate for this repository, please delete this section.

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2022.3.14f1
  • External Dependency Manager version: 1.2.177
  • Source you installed EDM4U: .unitypackage (.unitypackage or Unity Package Manager)
  • Features in External Dependency Manager in use: Android Resolver (Android Resolver, iOS Resolver, VersionHandler, etc.)
  • Plugins SDK in use: Firebase (Firebase, Admob, Facebook, etc.)
  • Platform you are using the Unity editor on: Error occur in Windows but not on MacOS (Mac, Windows, or Linux)

[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.)

The issue is an inconsistency with windows and MacOS for the android resolver when trying to load a dependency in a local folder when the folder as been moved. It is working in MacOS but not in windows.

  • Open or create the project following the instructions and click Force Resolve on android dependencies.
  • The resolution fails and you can experience the issue. The issue does not happen in MacOS but does happen in windows (11).
  • The issue seems to come from the FindPathUnderDirectory() method from FileUtils.cs in Google.VersionHandlerImpl This method returns a fallback folder for MacOS but returns null for windows.
  • The issue happens when the original folder of Firebase is changed. In the normal path, android resolver runs the path from AnalyticsDependencies.xml as "Assets/Firebase/m2repository". When the folder is changed it tries the FindPathUnderDirectory methods which fails in windows. The issue "can be fixed" by changing the path in the AnalyticsDependencies.xml with "Assets/Externals/Firebase/m2repository". This obviously defies the purpose but can provide a very temporary fix.

image
image
image

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.

  • Create a new project in Unity 2022.3.14f1 (the version should not matter)
  • Add the External Dependency manager package
  • Add the FirebaseAnalytics.unitypackage from https://firebase.google.com/download/unity
  • Switch Unity platform to android
  • Enable android auto-resolution --> Everything works as intended.
  • Move Firebase folder into a newly create "Externals" folder.
  • Force Resolve android dependencies
  • Android Dependencies Resolution Failed! --> This occurs on Windows11 but not on MacOS

You can directly download and add the androidResolverIssueSample.unitypackage to any empty project to experience the issue. I am not allow to copy it here since there is a 25MB limit and the project is 82MB. I'll try to add it in a comment after this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions