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] Unable to copy 'mainTemplate.gradle' from Unity engine folder #717

Open
manwithsteelnerves opened this issue Nov 11, 2024 · 1 comment

Comments

@manwithsteelnerves
Copy link

[REQUIRED] Please fill in the following fields:
Unity editor version: 2021.3.44f1
External Dependency Manager version: 1.2.183
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: None
Platform you are using the Unity editor on: Mac (Mac, Windows, or Linux)
[REQUIRED] Please describe the issue here:
The New Unity projects have no Assets/Plugins/Android directory by default so copy the mainTemplate.gradle file fails with DirectoryNotFoundException.
Certainly, manually creating this path in the project resolves everything.
There was a bug report earlier on the same and was mentioned to be fixed in 1.2.183 but looks like it's not yet fixed.
Please answer the following, if applicable:
What's the issue repro rate?
100% for new unity projects.

What happened? How can we make the problem occur?

Create new Unity project.
Import EDM4U .unitypackage
Add some Dependencies.xml
Resolve dependencies.
Get error in console.
Error log from console:

Unable to copy 'mainTemplate.gradle' from Unity engine folder '/Applications/Unity/Hub/Editor/2021.3.44f1/PlaybackEngines/AndroidPlayer/Tools/GradleTemplates' to this project folder 'Assets/Plugins/Android'. 
 System.IO.DirectoryNotFoundException: Could not find a part of the path "/Volumes/Work/Projects/Products/AssetStore/Cross Platform Essential Kit/UnityProject_UAS/Assets/Plugins/Android/mainTemplate.gradle".
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x00164] in <cc3b6a43a5b444d18b5045dd5758f771>:0 
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options) [0x00000] in <cc3b6a43a5b444d18b5045dd5758f771>:0 
  at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions)
  at System.IO.FileSystem.CopyFile (System.String sourceFullPath, System.String destFullPath, System.Boolean overwrite) [0x00035] in <cc3b6a43a5b444d18b5045dd5758f771>:0 
  at System.IO.File.Copy (System.String sourceFileName, System.String destFileName, System.Boolean overwrite) [0x00062] in <cc3b6a43a5b444d18b5045dd5758f771>:0 
  at System.IO.File.Copy (System.String sourceFileName, System.String destFileName) [0x00000] in <cc3b6a43a5b444d18b5045dd5758f771>:0 
  at GooglePlayServices.GradleTemplateResolver.EnsureGradleTemplateEnabled (System.String templateName) [0x00029] in /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/GradleTemplateResolver.cs:783 
UnityEngine.Debug:LogError (object)
Google.Logger:Log (string,Google.LogLevel) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/VersionHandlerImpl/src/Logger.cs:136)
GooglePlayServices.PlayServicesResolver:Log (string,Google.LogLevel) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1077)
GooglePlayServices.GradleTemplateResolver:EnsureGradleTemplateEnabled (string) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/GradleTemplateResolver.cs:785)
GooglePlayServices.PlayServicesResolver:EnableGradleTemplates () (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1773)
GooglePlayServices.PlayServicesResolver:ResolveUnsafeAfterMainTemplateCheck (System.Action`1<bool>,bool,bool,bool) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1806)
GooglePlayServices.PlayServicesResolver/<>c__DisplayClass110_0:<ScheduleResolve>b__1 () (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1751)
GooglePlayServices.PlayServicesResolver:ExecuteNextResolveJob () (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1598)
GooglePlayServices.PlayServicesResolver:ScheduleResolve (bool,bool,System.Action`1<bool>,bool) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1764)
GooglePlayServices.PlayServicesResolver:ExecuteMenuResolve (bool) (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2143)
GooglePlayServices.PlayServicesResolver:MenuResolve () (at /Users/amaurice/Documents/GitHub/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2159)

@google-oss-bot
Copy link

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

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