Skip to content

[Bug] unexpected char: '\' when using project export #498

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

Closed
andreimamlay opened this issue Jan 25, 2022 · 7 comments · Fixed by #509
Closed

[Bug] unexpected char: '\' when using project export #498

andreimamlay opened this issue Jan 25, 2022 · 7 comments · Fixed by #509

Comments

@andreimamlay
Copy link

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2021.1.16f1
  • External Dependency Manager version: 1.2.168
  • Source you installed EDM4U: .unitypackage
  • Features in External Dependency Manager in use: Android Resolver
  • Plugins SDK in use: Firebase, GoogleSignIn
  • Platform you are using the Unity editor on: Windows

[REQUIRED] Please describe the issue here:

  1. Install Firebase from .unitypackage
  2. Enable
  • Custom Main Gradle Template
  • Custom Launcher Gradle Template
  • Custom Gradle Properties Template
  1. Export project
  2. Open unityLibrary/build.gradle
  3. See incorrect path in local maven url

Please answer the following, if applicable:

100%

Caused by the following code in PlayServicesResolver.cs

// If "Export Gradle Project" setting is enabled, gradle project expects
// absolute path.
if (exportEnabled) {
    repoUri = String.Format("\"{0}\"",
                            Path.Combine(projectFileUri, repoPath));
}

For example, Path.Combine("file:///C:/Unity/TestGame", "Assets/GeneratedLocalRepo/Firebase/m2repository") produces file:///C:/Unity/TestGame\Assets/GeneratedLocalRepo/Firebase/m2repository

@google-oss-bot
Copy link

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

@paulinon paulinon removed the new to be triaged label Jan 25, 2022
@paulinon
Copy link
Collaborator

Hi @andreimamlay,

Thanks for reporting this, @andreimamlay. Version 1.2.169 of the resolver has been released recently. Could you confirm if the issue persists using that version as well?

@paulinon paulinon added the needs-info Need information for the developer label Jan 25, 2022
@andreimamlay
Copy link
Author

Thank you for your time, @paulinon .

I have

  1. updated external dependency manager (using external-dependency-manager-1.2.169.unitypackage)
  2. forced resolve

and can confirm, that issue remains: incorrect path delimiter is inserted into maven.url configuration

In master branch the following code still remains and causes incorrect delimiter on windows platform

repoUri = String.Format("\"{0}\"",
Path.Combine(projectFileUri, repoPath));

Changing said line to

repoUri = String.Format("\"{0}\"",
                        Path.Combine(projectFileUri, repoPath).Replace("\\", "/"));

would fix the problem on windows platform

@google-oss-bot google-oss-bot added needs-attention Need Googler's attention and removed needs-info Need information for the developer labels Jan 26, 2022
@paulinon
Copy link
Collaborator

Thanks for the information, @andreimamlay. I was able to observe this behavior on a Windows platform as well.

I'll let the team know about this. That being said, I'll be marking this as a bug for now.

@paulinon paulinon added type: bug and removed type: question needs-attention Need Googler's attention labels Jan 26, 2022
@andreimamlay
Copy link
Author

There was a PR for this issue!

#421

paulinon added a commit to paulinon/unity-jar-resolver that referenced this issue Jan 28, 2022
@andreimamlay
Copy link
Author

@paulinon
Could you please look again at this issue?

@chkuang-g
Copy link
Collaborator

#421 was merged. I am preparing a new release of EDM4U once I got another patch in.

If you need the patch soon, you can rebuild EDM4U using

# Build .unitypackage
./gradlew buildPlugin

# Build .tgz
./gradlew buildUPMPlugin

chkuang-g added a commit that referenced this issue Apr 4, 2022
- Version 1.2.170 - Apr 4, 2022
* Android Resolver - Fixes #498 - Fix the path separator of the Maven repo
  injected to `mainTemplate.gradle`.
* iOS Resolver - Fixes #470 - Switch default Cocoapods master repo from Github
  to CDN.
* iOS Resolver - `Link Framework Statically` setting is now default to `true`.
  That is, `use_frameworks! :linkage => static` will be added to `Podfile` by
  default instead of `use_frameworks!`. This can be changed in iOS Resolver
  settings. This fixes odd behaviors when pods include static libraries, ex.
  Firebase Analytics.
* iOS Resolver - Added a workaround when app crashes on launch due to
  `Library not loaded: @rpath/libswiftCore.dylib` when some pods includes Swift
  framework. This is turned `OFF` by default and can be changed in iOS Resolver
  settings.
chkuang-g added a commit that referenced this issue Apr 4, 2022
- Version 1.2.170 - Apr 4, 2022
* Android Resolver - Fixes #498 - Fix the path separator of the Maven repo
  injected to `mainTemplate.gradle`.
* iOS Resolver - Fixes #470 - Switch default Cocoapods master repo from Github
  to CDN.
* iOS Resolver - `Link Framework Statically` setting is now default to `true`.
  That is, `use_frameworks! :linkage => static` will be added to `Podfile` by
  default instead of `use_frameworks!`. This can be changed in iOS Resolver
  settings. This fixes odd behaviors when pods include static libraries, ex.
  Firebase Analytics.
* iOS Resolver - Added a workaround when app crashes on launch due to
  `Library not loaded: @rpath/libswiftCore.dylib` when some pods includes Swift
  framework. This is turned `OFF` by default and can be changed in iOS Resolver
  settings.
chkuang-g added a commit that referenced this issue Apr 6, 2022
- Version 1.2.170 - Apr 4, 2022
* Android Resolver - Fixes #498 - Fix the path separator of the Maven repo
  injected to `mainTemplate.gradle`.
* iOS Resolver - Fixes #470 - Switch default Cocoapods master repo from Github
  to CDN.
* iOS Resolver - `Link Framework Statically` setting is now default to `true`.
  That is, `use_frameworks! :linkage => static` will be added to `Podfile` by
  default instead of `use_frameworks!`. This can be changed in iOS Resolver
  settings. This fixes odd behaviors when pods include static libraries, ex.
  Firebase Analytics.
* iOS Resolver - Added a workaround when app crashes on launch due to
  `Library not loaded: @rpath/libswiftCore.dylib` when some pods includes Swift
  framework. This is turned `OFF` by default and can be changed in iOS Resolver
  settings.
chkuang-g added a commit that referenced this issue Apr 6, 2022
- Version 1.2.170 - Apr 4, 2022
* Android Resolver - Fixes #498 - Fix the path separator of the Maven repo
  injected to `mainTemplate.gradle`.
* iOS Resolver - Fixes #470 - Switch default Cocoapods master repo from Github
  to CDN.
* iOS Resolver - `Link Framework Statically` setting is now default to `true`.
  That is, `use_frameworks! :linkage => static` will be added to `Podfile` by
  default instead of `use_frameworks!`. This can be changed in iOS Resolver
  settings. This fixes odd behaviors when pods include static libraries, ex.
  Firebase Analytics.
* iOS Resolver - Added a workaround when app crashes on launch due to
  `Library not loaded: @rpath/libswiftCore.dylib` when some pods includes Swift
  framework. This is turned `OFF` by default and can be changed in iOS Resolver
  settings.
@googlesamples googlesamples locked and limited conversation to collaborators May 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants