-
Notifications
You must be signed in to change notification settings - Fork 555
[Flutter 3.29] UnityLibrary Build Fails in New Flutter Projects Using Gradle Kotlin DSL (build.gradle.kts) #1002
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
Comments
@juicycleff Hi Hope you are doing well, I am trying this solution from the last 5 days. I am unable to find the solution. Even I tried with your experimental link. [](#966) I got this error after running the flutter project. ![]() |
@juicycleff In your plugin
// implementation(name: 'flutter', ext:'jar') Error in flutter build apk
|
I just updated the master branch with some Kotlin DSL fixes. I updated the readme with the new syntax, and the Unity export script now handles .gradle.kts files. With those I managed to build and run the plugin in a new Flutter 3.29 project. As this is on the master branch and not pub.dev: For Flutter: you can either download the plugin and include it using a relative path
or include it using the git url.
For Unity: |
Thanks a lot for your help, @timbotimbo . Your solution resolved my Flutter KTS issue, which I had been troubleshooting for the past five days. Now, I can successfully generate both Android and iOS builds without any blockers. Really appreciate your detailed explanation and guidance! |
Description:
In newly created Flutter projects, Flutter now generates only build.gradle.kts (Gradle Kotlin DSL) files instead of traditional build.gradle (Groovy). When trying to build unityLibrary, the build fails because it does not recognize build.gradle.
I'm facing a compilation issue when using flutter_unity_widget in my Flutter project, which uses Gradle Kotlin DSL (build.gradle.kts). The error occurs when running ./gradlew assembleDebug or flutter build.
Error Log
Execution failed for task ':flutter_unity_widget:compileReleaseKotlin'.
Kotlin Version
kotlin -version
Kotlin version 2.1.10-release-473 (JRE 17.0.14+0)
Steps to Reproduce:
Create a Flutter project with Gradle Kotlin DSL (build.gradle.kts).
Add flutter_unity_widget as a dependency.
Run flutter pub get.
Attempt to build the project with flutter build apk or ./gradlew assembleDebug.
The text was updated successfully, but these errors were encountered: