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.13k stars 518 forks source link

Using fuw-2022.2.0.unitypackage to export is good on iOS, but not ok on Android #846

Closed khangpt closed 1 year ago

khangpt commented 1 year ago

Describe the bug I'm currently using Unity version 2022.3.4f1 Import fuw-2022.2.0.unitypackage to export my unity project to Flutter. When I follow the guide on pub.dev, then build on iOS device is good, everything run as I expected. But when I config to build on Android, I got some error when run build in Flutter

Screenshot 2023-07-18 at 8 32 17

I can't understand where this manifest file is in unityLibrary folder. This below is all that I have after export from Unity:

Screenshot 2023-07-18 at 8 42 15

To Reproduce Steps to reproduce the behavior:

  1. Click on "Export Android Release" in Unity editor
  2. Config same with the guidance
  3. Run "flutter run --release" or "flutter run --debug" on real device
  4. Get the error

Expected behavior Build on Android is OK

Unity (please complete the following information):

Smartphone (please complete the following information):

Additional context No more

khangpt commented 1 year ago

After a couple of time I spent to investigate the issue, I recognize that, in file Build.cs, function ModifyAndroidGradle, it should exist the AndroidManifest.xml file in unity/UnityProjectName/src/main/AndroidManifest.xml. But no, at this path in my exported unityLibrary folder, there's no manifest file like this. This is a issue of export script in Unity Editor, isn't it?

timbotimbo commented 1 year ago

The appmanifest is this issue https://github.com/juicycleff/flutter-unity-view-widget/issues/801#issuecomment-1597499527.

It also mentions namespace, which I believe is from Android gradle plugin 8+. Change that to 7.x, or use the pull request for 8.

khangpt commented 1 year ago

The appmanifest is this issue #801 (comment).

It also mentions namespace, which I believe is from Android gradle plugin 8+. Change that to 7.x, or use the pull request for 8.

thanks for quick reply. After I upgrade XR management package to 4.4, manifest file is export ok. But now I encounter another error :

Screenshot 2023-07-18 at 15 47 36

could you tell me what should I do here :)

timbotimbo commented 1 year ago

This second error turns into #844, let's continue that one there.