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

Call API function on dispose error

Open tuanha2000vn opened this issue 3 years ago • 6 comments

Hi, whenever i tried to call _unityWidgetController.dispose/unload/pause/postMessage... in dispose the app did nothing with the following error

  @override
  void dispose() {
    super.dispose();
    _unityWidgetController.dispose();
  }
Unhandled Exception: MissingPluginException(No implementation found for method unity#pausePlayer on channel plugin.xraph.com/unity_view_8)
E/flutter (14940): #0      MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:156
E/flutter (14940): <asynchronous suspension>
E/flutter (14940): #1      MethodChannelUnityViewFlutter.pausePlayer
package:flutter_unit

However if i call in button press it work fine

 IconButton(
                    icon: Icon(
                      Icons.chevron_left,
                    ),
                    onPressed: () {
                      _unityWidgetController.pause();
                      Navigator.of(context).pop();
                    },
                  ),

Did I miss something? Thank you.

PS: I use flutter_unity_widget: ^4.0.1+1

tuanha2000vn avatar Mar 29 '21 15:03 tuanha2000vn

same issues

silentchild avatar Aug 10 '21 08:08 silentchild

Same issues. Im using flutter_unity_widget 4.2.1

adithamafadil avatar Oct 14 '21 02:10 adithamafadil

@juicycleff @Ahmadre This bug still exist, and I think its important to refer some suggestions how to fix it.

dawiddszewczyk avatar Jul 16 '22 20:07 dawiddszewczyk

@dawiddszewczyk what platform?

juicycleff avatar Jul 16 '22 21:07 juicycleff

@juicycleff Unity: OS: iOS Version 15.5 Editor Version 2021.1.24f1

Smartphone: Device: iPhone SE OS: iOS Version 15.5

There also similar issue

dawiddszewczyk avatar Jul 16 '22 21:07 dawiddszewczyk

Will mark it as buy a d assign it to me

juicycleff avatar Jul 16 '22 21:07 juicycleff