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] gradle modifications not compatible with gradle version latest Unity uses #715

Open
idamaeng opened this issue Oct 29, 2024 · 6 comments · May be fixed by #718
Open

[Bug] gradle modifications not compatible with gradle version latest Unity uses #715

idamaeng opened this issue Oct 29, 2024 · 6 comments · May be fixed by #718
Assignees
Labels
needs-info Need information for the developer type: bug

Comments

@idamaeng
Copy link

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 6000.0.23f1
  • External Dependency Manager version: 1.2.83
  • Source you installed EDM4U: UPM (.unitypackage or Unity Package Manager)
  • Features in External Dependency Manager in use: All (Android Resolver, iOS Resolver, VersionHandler, etc.)
  • Plugins SDK in use: Firebase, Admob, Facebook, etc.
  • Platform you are using the Unity editor on: Mac (Mac, Windows, or Linux)

[REQUIRED] Please describe the issue here:

EDM4U adds following information to mainTemplate.gradle:

// Android Resolver Exclusions Start android { packaging { exclude ('/lib/armeabi/*' + '*') exclude ('/lib/mips/*' + '*') exclude ('/lib/mips64/*' + '*') exclude ('/lib/x86/*' + '*') exclude ('/lib/x86_64/*' + '*') } } // Android Resolver Exclusions End

This is not compatible with the gradle version Untiy is using. When triggering the build process Unity is complaining about this and converts this the snippet above to:

// Android Resolver Exclusions Start android { packagingOptions { exclude ('/lib/armeabi/*' + '*') exclude ('/lib/mips/*' + '*') exclude ('/lib/mips64/*' + '*') exclude ('/lib/x86/*' + '*') exclude ('/lib/x86_64/*' + '*') } } // Android Resolver Exclusions End

Which always creates a mainTemplate.gradle.backup files cluttering my project. Please adjust the plugin to use packagingOptions instead of packaging.

Thank you

@idamaeng idamaeng added new to be triaged type: question labels Oct 29, 2024
@google-oss-bot
Copy link

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

@argzdev argzdev added type: bug and removed type: question new to be triaged labels Oct 29, 2024
@idamaeng
Copy link
Author

This is a screenshot of the message:

Screenshot 2024-10-29 at 18 07 23

@argzdev
Copy link
Collaborator

argzdev commented Nov 4, 2024

Hey @idamaeng, thanks for reaching out. It seems that the latest EDM4U 1.2.183 is already using the packagingOptions keyword.

lines.Add("android {");
lines.Add(" packagingOptions {");
foreach (var filename in sortedExcludeFiles) {

I wonder if it's being overwritten somewhere else. I tried using any Firebase products from the Firebase Unity Quickstart to test this but so far I'm getting the expected output.

mainTemplate.gradle

// Android Resolver Exclusions Start
android {
  packagingOptions {
      exclude ('/lib/arm64-v8a/*' + '*')
      exclude ('/lib/armeabi/*' + '*')
      exclude ('/lib/mips/*' + '*')
      exclude ('/lib/mips64/*' + '*')
      exclude ('/lib/x86/*' + '*')
      exclude ('/lib/x86_64/*' + '*')
  }

In this case, could you provide me a minimal reproducible example. Or perhaps steps how you were able to reproduce this behavior so I can investigate this further? Thanks a bunch!

@argzdev argzdev added needs-info Need information for the developer and removed type: bug labels Nov 4, 2024
@argzdev argzdev self-assigned this Nov 4, 2024
@google-oss-bot google-oss-bot added the stale Don't have recent activity label Nov 11, 2024
@google-oss-bot
Copy link

Hey @idamaeng. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@Thaina
Copy link

Thaina commented Nov 13, 2024

@argzdev I think the problem is opposite

We've detected that your custom Assets/Plugins/Android\mainTemplate.gradle file is using deprecated attributes such as packagingOptions. We can fix this automatically, your current mainTemplate.gradle file will be backed up. Continue?

It seem unity 6 was telling that packagingOptions should not be used. And ths popup instead changed into just packaging

image

@google-oss-bot google-oss-bot removed the stale Don't have recent activity label Nov 13, 2024
@argzdev argzdev linked a pull request Nov 13, 2024 that will close this issue
@argzdev
Copy link
Collaborator

argzdev commented Nov 13, 2024

Hey @Thaina, thanks for clarifying that. You're right. I did some research and it looks like the packaging was introduced in AGP 8.0+. Since Unity 6 uses AGP 8.3.0+, it should use this keyword instead.

I created a PR to fix this. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-info Need information for the developer type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants