juicycleff / flutter-unity-view-widget

Embeddable unity game engine view for Flutter. Advance demo here https://github.com/juicycleff/flutter-unity-arkit-demo
BSD 3-Clause "New" or "Revised" License
2.09k stars 504 forks source link

Build fail if unity switched to Unity 6 preview #962

Closed TNemecek closed 1 day ago

TNemecek commented 1 week ago

Describe the bug When switching to the Unity 6, build fails in unity with this error:

Launching lib\main.dart on ASUS Z017D in debug mode...
Running Gradle task 'assembleDebug'...
You are applying Flutter's app_plugin_loader Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/go/flutter-gradle-plugin-apply

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* Where:
Build file 'C:\Projects\UNITY projects\improvio\android\unityLibrary\build.gradle' line: 2

* What went wrong:
A problem occurred evaluating project ':unityLibrary'.
> Could not read script 'C:\Projects\UNITY projects\improvio\android\shared\keepUnitySymbols.gradle' as it does not exist.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':unityLibrary'.
> compileSdkVersion is not specified. Please add it to build.gradle

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
Error: Gradle task assembleDebug failed with exit code 1

To Reproduce Steps to reproduce the behavior:

  1. Switch unity version to 6 (preview)
  2. Build release flutter from unity
  3. Build flutter app
  4. See error when build failed

Expected behavior Build app

Screenshots image

Unity (please complete the following information):

Smartphone (please complete the following information):

Additional context It may be still preview, bud it appears that it will need some changes to fix.

timbotimbo commented 1 week ago

Unity 2023 broke android compatibility, so 6 isn't supported yet either. https://github.com/juicycleff/flutter-unity-view-widget/issues/839

TNemecek commented 3 days ago

Jeslti se mohu zeptat, v jakém stavu se tedy nachází fix? V Unity 6 je práví řada nových funkcionalit, které by se nám výrazně hodili, případně jestli se musíme spokojit zatím s nižší verzí.

EDIT: translation (timbotimbo)

If I may ask, what is the condition of the fix? There are a number of new features in Unity 6 that we could use, or if we have to settle for a lower version for now.

timbotimbo commented 1 day ago

I added a branch to test an alpha implementation for Unity 6. Check https://github.com/juicycleff/flutter-unity-view-widget/issues/967 for instructions.