Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Tbernard33 opened this issue Dec 7, 2023 · 4 comments

Comments

@Tbernard33
Copy link

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

@Tbernard33 Tbernard33 added new to be triaged type: question labels Dec 7, 2023
@paulinon paulinon removed the new to be triaged label Dec 7, 2023
@Tbernard33
Copy link
Author

Do you know how can I send you the package ? I'm stuck with this github error message :
image
If you don't need it let me know, it takes only a few more minutes to build it by hand.

@andres-decagames
Copy link

We are facing exactly the same issue. @Tbernard33 did you ever find a better fix than replacing the path on Dependencies.xml files?

@Tbernard33
Copy link
Author

Changing the AnalyticsDependencies.xml can be versioned so we did that a while ago and never changed it since.

No other solutions for now.

@andres-decagames
Copy link

We did the same for the moment. At least it's reassuring to know that this didn't cause any other issues for you during all this time. Thanks for your answer and for the workaround from the initial comment @Tbernard33 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants