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.15k stars 525 forks source link

Sample project crashing when adding Inworld Character to the sample scene #734

Open hvesuk opened 1 year ago

hvesuk commented 1 year ago

Describe the bug The app crashes after a few seconds when entering a scene that has an inworld character We tried to debug this problem by ourselves but we can't get any normal logs about what happened

To Reproduce Steps to reproduce the behavior:

  1. Download and configure sample flutter-unity-view-widget project
  2. Download and import the Inworld package (https://assetstore.unity.com/packages/tools/ai/ai-characters-dialogue-for-unity-inworld-229406)
  3. Go to the Inworld sample scene (Assets/Inworld.AI/Scenes/SampleBasic.unity) and copy all resources to the flutter-unity-widget sample scene
  4. Add Inworld API key (log in using Inworld -> Studio Panel -> Log In)
  5. Run a flutter-unity scene with inworld character and make sure that it reacts to your speech
  6. Build the project
  7. Run the scene with a character
  8. See crash

Expected behavior The scene runs without a problems

Unity (please complete the following information):

Smartphone (please complete the following information):

Additional context Added unity project that has the necessary scenes and assets https://drive.google.com/file/d/1jy1J82dChrvuMaricDz4Hr9plQyBT55P/view?usp=share_link

Thank for help

timbotimbo commented 1 year ago

A common reason for 3rd party libraries to break is because some of their code is stripped out.

For example for ARfoundation on android to work, you need to specify -keep class com.unity3d.plugin.* { *; } in proguard to avoid missing libraries.

But you would have to figure out the exact name of the inworld libraries to do the same.

As a test to see if it is being stripped you can do these 2 things:

If those 2 fix the crash, you know it is stripping. Otherwise it might be related to missing permissions or files being unreadable because of compression.