flutter-unity-view-widget icon indicating copy to clipboard operation
flutter-unity-view-widget copied to clipboard

java.lang.ClassNotFoundException: com.xraph.plugin.flutter_unity_widget.UnityPlayerUtils

Open jsonsuxing opened this issue 4 years ago • 3 comments

Describe the bug I/AudioTrack( 7429): isLongTimeZoreData zoer date time 4 Seconds I/Unity ( 7429): java.lang.ClassNotFoundException: com.xraph.plugin.flutter_unity_widget.UnityPlayerUtils I/Unity ( 7429): UnityEngine.Events.UnityAction:Invoke() I/Unity ( 7429): UnityEngine.Events.UnityEvent:Invoke() I/Unity ( 7429): UnityEngine.EventSystems.EventFunction1:Invoke(T1, BaseEventData) I/Unity ( 7429): UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction1) I/Unity ( 7429): UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchPress(PointerEventData, Boolean, Boolean) I/Unity ( 7429): UnityEngine.EventSystems.StandaloneInputModule:ProcessTouchEvents() I/Unity ( 7429): UnityEngine.EventSystems.StandaloneInputModule:Process() I/Unity ( 7429):
I/Unity ( 7429): (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35) I/Unity ( 7429): I/AudioTrack( 7429): isLongTimeZoreData zoer date time 5 Seconds I/AudioTrack( 7429): isLongTimeZoreData zoer date time 6 Seconds

To Reproduce Flutter can send messages to Unity, but unity cannot send messages to flutter, This happens when I call this method UnityMessageManager.Instance.SendMessageToFlutter()

  • macOS Big Sur 11.4
  • Unity 2021.1.16 f1c1
  • Flutter Channel stable 2.2.3
  • Android SDK 30.0.3

jsonsuxing avatar Aug 26 '21 11:08 jsonsuxing

I have the exact same issue too. iOS is working fine.

macOS Big Sur 11.5.1 Unity 2019.4.26f1 Flutter Channel stable (not sure what this is) flutter_unity_widget version 4.1.0 Android SDK 31.0.3

Update:

I managed to find the solution from posted by E-Kaese. https://github.com/juicycleff/flutter-unity-view-widget/issues/216#issuecomment-701962465

But i had to change the text to insert into android > unityLibrary > proguard-unity.txt:

-keep class com.unity3d.plugin.* { *; } -keep class com.xraph.plugin.flutter_unity_widget.UnityPlayerUtils { *; }

tingleestudios avatar Oct 28 '21 07:10 tingleestudios

Can confirm that @tingleestudios solutions works. Now .aab files includes the missing library

novavision avatar Nov 11 '21 02:11 novavision

this is somehow an issue for us since upgrading to flutter 3.0.x and adding the proguard settings fixed the problem. Is there any plan to add this to the new version of the flutter unity widget so it exists by default?

adam-fu avatar May 29 '22 06:05 adam-fu

Both -keep class com.xraph.plugin.** { *; } and -keep class com.unity3d.plugin.* { *; } are automatically included in the last couple of unitypackage versions that I checked.

Closing this as fixed / outdated.

timbotimbo avatar Jan 08 '23 15:01 timbotimbo