Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When re-open app untiy run error. #230

Closed
qiuguian opened this issue Oct 20, 2020 · 10 comments · Fixed by #245
Closed

When re-open app untiy run error. #230

qiuguian opened this issue Oct 20, 2020 · 10 comments · Fixed by #245
Assignees
Labels
bug This issue refers to a bug in the plugin

Comments

@qiuguian
Copy link

First time install app and run into unity page, it gos well

@qiuguian
Copy link
Author

But when I close app and re-open again, unity has error:
2020-10-20 12:20:19.035 928-1087/? E/ScreemCommon: jank frame opt scene object is null
2020-10-20 12:20:19.035 928-1087/? E/ScreemCommon: failed to recording jank bigdata of different frame rates
just happen in my android device, other person's run well.

@qiuguian
Copy link
Author

@juicycleff
Copy link
Owner

juicycleff commented Oct 21, 2020

@qiuguian please just call unitycontroller.quit in the flutter lifecycle manually before the app closes. I will release a fix for this and also create a video tutorial for both dev and production release.

@juicycleff
Copy link
Owner

@qiuguian the reason for this is that Unity player is still hanging on to memory and so quitting and starting again should fix this issue.

@qiuguian
Copy link
Author

@juicycleff Thank you for response, but I had tried two days, quitting and starting again can't not fix this issue. Can you fix in the plugin?

@qiuguian
Copy link
Author

Why Unity player is still hanging on to memory when I close the app and start again?

@qiuguian
Copy link
Author

Please help me to fix it! My project urgent, Thank you very much!

@juicycleff juicycleff added the bug This issue refers to a bug in the plugin label Oct 22, 2020
@juicycleff juicycleff self-assigned this Oct 22, 2020
@ilkercankaya
Copy link

I would kindly appreciate a fix for this issue too as I am planning to release an app with this library in it, thank you for the efford 👀

@qiuguian
Copy link
Author

@ilkercankaya @juicycleff I fix it by use PlatformViewLink Widget instead of AndroidView Widget:
PlatformViewLink(
surfaceFactory:
(BuildContext context, PlatformViewController controller) {
return AndroidViewSurface(
controller: controller,
gestureRecognizers: const <
Factory>{},
hitTestBehavior: PlatformViewHitTestBehavior.opaque,
);
},
viewType: _viewType,
onCreatePlatformView: (PlatformViewCreationParams params) {
return PlatformViewsService.initSurfaceAndroidView(
id: params.id,
viewType: _viewType,
layoutDirection: TextDirection.rtl,
creationParams: creationParams,
creationParamsCodec: const StandardMessageCodec(),
)
..addOnPlatformViewCreatedListener(params.onPlatformViewCreated)
..addOnPlatformViewCreatedListener(_onPlatformViewCreated)
..create();
});

@juicycleff
Copy link
Owner

juicycleff commented Nov 15, 2020

@qiuguian I hadn't had enough time to work on it but I am working on it now. Nice to know you've fixed it with that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue refers to a bug in the plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants