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] Android ForceResolve can not copy files to GeneratedLocalRepo (bad folder name) #583

Open
kkohno opened this issue Dec 20, 2022 · 13 comments

Comments

@kkohno
Copy link

kkohno commented Dec 20, 2022

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2022.2.1f1
  • 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: GooglePlayGames
  • Platform you are using the Unity editor on: Windows

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

  1. Open Unity project
  2. Switch to Android target
  3. enable Custom Mapi Gradle Template
  4. Set Up Google Play Games plugin for Unity v0.11.01 from .unipypackage without jar-resolver
  5. ForceResolve

Please answer the following, if applicable:

What's the issue repro rate? (eg 100%, 1/5 etc)
100%

What happened? How can we make the problem occur?

Unable to copy Assets\GooglePlayGames\com.google.play.games\Editor\m2repository\com\google\games\gpgs-plugin-support\0.11.01\gpgs-plugin-support-0.11.01.srcaar to Assets\GeneratedLocalRepo\GooglePlayGames\com.google.play.games\Editor\m2repository\com\google\games\gpgs-plugin-support\0.11.01\gpgs-plugin-support-0.11.01.aar.  Assets\GeneratedLocalRepo\GooglePlayGames\com.google.play.games\Editor\m2repository\com\google\games\gpgs-plugin-support\0.11.01\gpgs-plugin-support-0.11.01.aar will not be included in Gradle builds. Reason: Failed to copy Assets\GooglePlayGames\com.google.play.games\Editor\m2repository\com\google\games\gpgs-plugin-support\0.11.01\gpgs-plugin-support-0.11.01.srcaar to Assets\GeneratedLocalRepo\GooglePlayGames\com.google.play.games\Editor\m2repository\com\google\games\gpgs-plugin-support\0.11.01\gpgs-plugin-support-0.11.01.aar due to System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\repos\KkohnoLibs\My project (2)\Assets\GeneratedLocalRepo\GooglePlayGames\com.google.play.games\Editor\m2repository\com\google\games\gpgs-plugin-support\0.11.01\gpgs-plugin-support-0.11.01.aar'.
  at System.IO.FileSystem.CopyFile (System.String sourceFullPath, System.String destFullPath, System.Boolean overwrite) [0x00060] in <8f06425e63004caf99a79845675f751e>:0 
  at System.IO.File.Copy (System.String sourceFileName, System.String destFileName, System.Boolean overwrite) [0x00062] in <8f06425e63004caf99a79845675f751e>:0 
  at System.IO.File.Copy (System.String sourceFileName, System.String destFileName) [0x00000] in <8f06425e63004caf99a79845675f751e>:0 
  at GooglePlayServices.PlayServicesResolver.CopyAssetAndLabel (System.String sourceLocation, System.String targetLocation, System.Boolean force) [0x000a3] in /Users/drsanta/dev/tmp/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2481 
UnityEngine.Debug:LogError (object)
Google.Logger:Log (string,Google.LogLevel) (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/VersionHandlerImpl/src/Logger.cs:136)
GooglePlayServices.PlayServicesResolver:Log (string,Google.LogLevel) (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1069)
GooglePlayServices.GradleTemplateResolver:CopySrcAars (System.Collections.Generic.ICollection`1<Google.JarResolver.Dependency>) (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/AndroidResolver/src/GradleTemplateResolver.cs:167)
GooglePlayServices.GradleTemplateResolver:InjectDependencies (System.Collections.Generic.ICollection`1<Google.JarResolver.Dependency>) (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/AndroidResolver/src/GradleTemplateResolver.cs:488)
GooglePlayServices.PlayServicesResolver/<ResolveUnsafe>c__AnonStorey25:<>m__49 () (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1982)
Google.RunOnMainThread:ExecuteNext () (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:486)
Google.RunOnMainThread:<ExecuteAllUnnested>m__12 () (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:536)
Google.RunOnMainThread:RunAction (System.Action) (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:343)
Google.RunOnMainThread:ExecuteAllUnnested (bool) (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:530)
Google.RunOnMainThread:ExecuteAll () (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:512)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()

image

It is can be fixed if created folder name("0" see screen) manually rename to 0.11.01.

Mminimal project to reproduce

@kkohno kkohno added new to be triaged type: question labels Dec 20, 2022
@google-oss-bot
Copy link

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

@kkohno kkohno changed the title [Bug] can not copy files to GeneratedLocalRepo [Bug] Android ForceResolve can not copy files to GeneratedLocalRepo (bad folder name) Dec 20, 2022
@paulinon paulinon removed the new to be triaged label Dec 20, 2022
@paulinon
Copy link
Collaborator

Hi @kkohno,

Thanks for reporting this issue. I've used the sample project you provided, and I wasn't able to encounter this issue on the first try. A different error message appeared, but it went away after enabling Custom Gradle Properties Template. However, I should mention that I used the editor's latest LTS version (2021.3.16). While I try using the sample project with the version you specified, could you try using the aforementioned version and see if this would be applicable to your use case?

@paulinon paulinon added the needs-info Need information for the developer label Dec 20, 2022
@kkohno
Copy link
Author

kkohno commented Dec 20, 2022

we encountered this bug a long time ago, long before version 2021.3.16. this version reproduses the same bug. Note, the bug can be reproduces on windows. It seems, that Path.GetDirectoryName works different on windows with directory names, that includes dots, and parsed as filename

I suspect this or this lines has unexpected behaviour with directory names such as 0.11.01 on windows

@google-oss-bot google-oss-bot added needs-attention Need Googler's attention and removed needs-info Need information for the developer labels Dec 20, 2022
@kkohno
Copy link
Author

kkohno commented Dec 20, 2022

Has reinstalled the project again from scratch.
Reproduce steps
1 download project from repo
2 switch to android
3 call: Assets->External Dependency Manager->Android Resolver->Force Resolve (seems without bug, however error log)
4 repeate step 3

@paulinon
Copy link
Collaborator

Thanks for the update, @kkohno. I just realized that you're on a Windows machine while I was testing using macOS. Just tested using version 2022.2.1f1 on a Windows machine, and I was able to replicate this behavior. I'll be relaying my observations to the team about this. For now, let me mark this as a bug.

@paulinon paulinon added type: bug and removed type: question needs-attention Need Googler's attention labels Dec 21, 2022
@kkohno
Copy link
Author

kkohno commented Dec 21, 2022

ok, thanks

@chkuang-g
Copy link
Collaborator

Seems like @paulinon can reproduce this on Windows machine.

Hmm, I was expecting ad55ee6 to fix this issue already. This should be part of 1.2.175.

I suspect that AssetDatabase.CreateFolder() or Directory.CreateDirectory() behave differently in this version of Unity on Windows. We can take a look.

@kkohno
Copy link
Author

kkohno commented Dec 23, 2022

will be good

I suspect that AssetDatabase.CreateFolder() or Directory.CreateDirectory() behave differently in this version of Unity on Windows. We can take a look.

I face this bug with many versions of unity 2022 on Windows

@Mino1214
Copy link

Mino1214 commented Jan 18, 2023

I solved the same problem, but I'm not sure it would help displaying Ads on device(I'm still testing).
It seems when you press 'Force resolve' the resolver makes the folder name something like 0 or 0 1 or..so on.
But the those folder name should be 0.11.01 as they say on the error, the path from the 'GooglePlayGames' and 'GeneratedLocalRepo' should be the same.
After you modify the name of the folder then press the 'Force Resolve' then I would say succeed.
However, If you just 'Resolve' again, the same problem will occur, so I'm not sure it would really work.

@kkohno
Copy link
Author

kkohno commented Jan 26, 2023

I solved the same problem, but I'm not sure it would help displaying Ads on device(I'm still testing). It seems when you press 'Force resolve' the resolver makes the folder name something like 0 or 0 1 or..so on. But the those folder name should be 0.11.01 as they say on the error, the path from the 'GooglePlayGames' and 'GeneratedLocalRepo' should be the same. After you modify the name of the folder then press the 'Force Resolve' then I would say succeed. However, If you just 'Resolve' again, the same problem will occur, so I'm not sure it would really work.

Yes, it is solve problem, if rename directories manually. But another force resolve requires manually renamings again... It's annoying and not everyone will think of renaming folders.

@ahmedameen2
Copy link

Hi, Any update on this?

@cristianjuarezz
Copy link

This plugin is so broken, I already tried everything

@codrinalex1994
Copy link

Hi, any updates? @cristianjuarezz @ahmedameen2 @kkohno I have just to put this "0.11.01" instead of the folder named "0" everytime or there is another way? Please

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

8 participants