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

[Flutter 3.29] Update docs and build.cs to handle Kotlin .gradle.kts files. #1004

Merged
merged 1 commit into from
Feb 23, 2025

Conversation

timbotimbo2
Copy link
Contributor

Description

Since Flutter 3.29, new projects will use the Kotin gradle DSL.
Files like build.gradle and settings.gradle now have a .gradle.kts extension.

Besides the file extension change, the syntax is different.

For example:

- implementation project(':unityLibrary')
+ implementation(project(":unityLibrary"))
flatDir {
-    dirs "${project(':unityLibrary').projectDir}/libs"
+    dirs(file("${project(":unityLibrary").projectDir}/libs"))
}

This leads to issue like #1002

This PR:

  • Adds the new syntax in the README.
  • Make build.cs capable of adjusting .gradle.kts files in the Unity export.

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

I did not test the Unity Export Android Plugin option, as I'm not sure how that is used.
But I did update it with the same changes as the regular Android (debug/release) export, which I did test.

The example project needs to be updated before it will be compatible with Flutter 3.29.
For a new Flutter 3.29 project this PR is enough.

With Flutter 3.29 you will likely have to define ndkVersion in app/build.gradle.kts.
In my case, the Flutter console error messages told me to use ndkVersion = "27.0.12077973".

@timbotimbo timbotimbo self-requested a review February 23, 2025 23:00
@timbotimbo timbotimbo merged commit 8dab4d3 into juicycleff:master Feb 23, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants