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 505 forks source link

Issue when exporting from unity 2022.3.xx #876

Closed nimr77 closed 9 months ago

nimr77 commented 9 months ago

Describe the bug when exporting from unity version 2022.3.xx, it doesn't complete the exporting and it has a missing android build files

To Reproduce Steps to reproduce the behavior:

  1. install unity 2022.3.xxx
  2. install flutter_unity_package for unity to export with flutter
  3. export with ( flutter => export android )
  4. See error

Expected behavior to have a full unityLibrary ready to use

Screenshots

Screenshot 2023-09-14 at 00 06 55

LOGS FROM UNITY

FileNotFoundException: Could not find file "/Users/nimrsawafta/MyProjects/StreetUP/mobile/android/unityLibrary/src/main/AndroidManifest.xml"
System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) (at <130809ae6f984869a6663c878f16e3f3>:0)
System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options) (at <130809ae6f984869a6663c878f16e3f3>:0)
(wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions)
System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, System.Boolean detectEncodingFromByteOrderMarks, System.Int32 bufferSize) (at <130809ae6f984869a6663c878f16e3f3>:0)
System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, System.Boolean detectEncodingFromByteOrderMarks) (at <130809ae6f984869a6663c878f16e3f3>:0)
(wrapper remoting-invoke-with-check) System.IO.StreamReader..ctor(string,System.Text.Encoding,bool)
System.IO.File.InternalReadAllText (System.String path, System.Text.Encoding encoding) (at <130809ae6f984869a6663c878f16e3f3>:0)
System.IO.File.ReadAllText (System.String path) (at <130809ae6f984869a6663c878f16e3f3>:0)
FlutterUnityIntegration.Editor.Build.ModifyAndroidGradle (System.Boolean isPlugin) (at Assets/FlutterUnityIntegration/Editor/Build.cs:344)
FlutterUnityIntegration.Editor.Build.DoBuildAndroid (System.String buildPath, System.Boolean isPlugin, System.Boolean isReleaseBuild) (at Assets/FlutterUnityIntegration/Editor/Build.cs:231)
FlutterUnityIntegration.Editor.Build.DoBuildAndroidLibraryDebug () (at Assets/FlutterUnityIntegration/Editor/Build.cs:34)

Additional context Workaround is to build with another version like 2021.xxx and replace the src folder of unityLibrary

timbotimbo commented 9 months ago

This might be caused by a buggy package installed in your Unity project. "XR Plugin Management" versions 4.3.x will delete your androidmanifest file, breaking the export process.

Check the unity package manager for this package. You can also check the packages folder in your Unity project. See if manifest.json or package-lock.json contain com.unity.xr.management.

nimr77 commented 9 months ago

But we need the Plugin for AR, and the project doesn't include in the package-lock.json or manifest.json

nimr77 commented 9 months ago

https://github.com/juicycleff/flutter-unity-view-widget/issues/801