Skip to content

Experimental Unity 6 (6000) support. #967

Open
@timbotimbo

Description

@timbotimbo

Description

Unity 2023.1 and 6 (6000.0) include breaking changes for the Android version of this plugin.
And given that 2023.3 turned into 6000, I decided to implement support for Unity 6000.

For a litte more info, see the PR #966

Installing & testing

This alpha version is now live in the experimental/unity_6000 branch.

You can either download it and include the plugin using a relative path

flutter_unity_widget:
    path: <folder path>

or include it using the git url

flutter_unity_widget:
    git:
      url: https://github.com/juicycleff/flutter-unity-view-widget.git
      ref: experimental/unity_6000 # branch name

Update
The branch now also includes a fuw-6000.0.1.unitypackage.

Setup (android)

  1. Follow the regular android setup like in the readme. But ignore setting ndk.dir= in local.properties.
    Use the ndkVersion = "<ndk version number here>" approach.

  2. Your Flutter project will need to use Java 17 and gradle 8.x to match the versions used by Unity.
    Check the example project in the unity_6000 branch for the relevant build.gradle files.

Unity Version Gradle Version Android Gradle Plug-in Version NDK JDK
6000.0.45f1+ 8.11 8.7.2 r27c (27.2.12479018) 17
6000.0.1f1 - 6000.0.44f1 8.4 8.3.0 r27c (27.2.12479018) 17
  1. Update.
    Use the 6000.0.x unitypackage or copy the latest unity/Assets/FlutterUnityIntegration/Editor folder from the branch into your Unity project.

  2. Set the Unity Application Entry Point to Activity.
    Player Settings -> Settings for Android -> Other Settings -> Application Entry Point

  3. After the Unity export, android/unityLibrary/build.gradle might include a broken import.

    • Either fix this automatically by updating your Assets/FlutterUnityIntegration/Editor/build.cs file with the one from the example project.
    • Or comment the 2nd line apply from: '../shared/keepUnitySymbols.gradle' in unityLibrary/build.gradle

Setup (ios)

There don't seem to be any breaking changes in the plugin for iOS.

You do need a small change in the Unity export.
Use the 6000.0.0 unitypackage or copy the latest unity/Assets/FlutterUnityIntegration/Editor folder from the branch into your Unity project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    androidThis issue is specific to the Android Platform.enhancementNew feature or requesthelp wantedExtra attention is needediosThis issue is specific to the iOS/iPadOS Platform.unity breaking change

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions