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

Revert "Workaround for disposal crash with flutter3 (#1172)" #1212

Closed
wants to merge 1 commit into from

Conversation

felix-ht
Copy link
Collaborator

@felix-ht felix-ht commented Oct 17, 2022

This reverts commit 2ebb7a5.

I decided to revert this merge commit as it causes issues with old flutter versions - apparently the interface of TextureAndroidViewController changed - this causes the version post this commit to no longer build for flutter 2.X

Might be tricky to get this working for 2.x and 3.x.

I guess that we could use introspection to call the right method?

@felix-ht felix-ht requested a review from AAverin October 17, 2022 14:49
@felix-ht felix-ht temporarily deployed to ANDROID_CI_DOWNLOADS_TOKEN October 17, 2022 14:49 Inactive
@felix-ht felix-ht temporarily deployed to ANDROID_CI_DOWNLOADS_TOKEN October 17, 2022 14:49 Inactive
@dawid-niedzwiecki
Copy link

Please don't merge that.

@AAverin
Copy link
Contributor

AAverin commented Oct 19, 2022

we can still keep the workaround as a separate branch
@dawid-niedzwiecki any reason not to merge?

@srmncnk
Copy link
Contributor

srmncnk commented Oct 19, 2022

I guess that we could use introspection to call the right method?

Can be done. Is as ugly as swizzling on iOS, but on the other hand, that would allow us to know on which flutter version we run. I would need an evening of two to make this work, I suggest we leave this open and make an effort to try and fix it.

Basically make this workaround work with reflection / introspection and, if detected that we don't run on flutter 3.x.x, don't use the workaround.

@srmncnk
Copy link
Contributor

srmncnk commented Oct 21, 2022

Looked into this and I must admit that I falsely saw this to be an Java/Kotlin issue. Since this is breaking the Flutter API, we would have to use introspection / reflection there. AFAIK 'dart:mirrors' is not supported on flutter and using reflectable with code generation probably wouldn't work on flutter API classes as well?

I was however able to somewhat unify flutter2 and flutter3 API in a way that it doesn't break behaviour, doesn't leak resources and still compiles for both SDKs. I tested with 2.10.5 and 3.3.5. It's a bit lucky. See this PR:
#1217

@felix-ht
Copy link
Collaborator Author

closed in favor of #1217

@felix-ht felix-ht closed this Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants