-
Notifications
You must be signed in to change notification settings - Fork 65
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
Error: No named parameter with the name 'forceDirectlyCallNextVsyncTargetTime'. #182
Comments
Hi! Thanks for opening your first issue here! 😄 |
Hi, have you used the engine and flutter under |
https://github.com/fzyzcjy/flutter/tree/flutter-smooth |
So, looks like the function is there, but your environment somehow does not pick up it? You need to build the whole engine by yourself, i.e. compile that large C++ codebase |
Thank you. I'm trying. I don't know if it's related to the Mac m1 chip |
You are welcome |
Hello! Any updates on this? I am having the exact same problem but on Windows 10, I'm able to compile the custom engine and when I set the |
Hmm, did you follow the official Flutter doc about picking the custom engine from framework? |
Hey again! Yes, I believe so. Here are the steps I followed to do it (I tried both optimized and unoptimized builds, for Windows and Android):
I have tried everything I've been able to and still, it seems like flutter is just not picking the custom engine. If I missed any steps when building or running, please let me know a better way to do it. I also made a modification to
Finally, here are three videos (.gif format) of all the errors mentioned:
Thank you so much for your attention and support. |
I am not an expert in compiling engine in windows (I am on MacOS). So just guesses here: When running it, have you tried https://github.com/flutter/flutter/wiki/The-flutter-tool#using-a-locally-built-engine-with-the-flutter-tool to ensure flutter framework pick up the right engine? If not, you compiled the engine but not use it when running Flutter code. |
Hi again! Yes, I have tried it. After uncountable attempts, I have finally been able to compile the app without errors, but there are a few issues that I will talk about more in-depth when I post a report on this in a near future (maybe tomorrow or in a few days). To say it briefly, I renamed the which I was able to download from https://storage.googleapis.com/download.flutter.io (a url which was quite hidden in the flutter.gradle file btw, and the versions of both sources armeabi_v7a_profile and flutter_embedding_profile had to match, otherwise the app wouldn't build and it would throw no error informing about the version mismatch). However, there were still two files missing, of the form maven-metadata.xml, which weren't available at https://storage.googleapis.com/download.flutter.io. After some research, I found some urls that looked realiable and real, from maven and jcenter (which is no longer up) such as https://dl.google.com/dl/android/maven2/io/flutter , https://repo.maven.apache.org/maven2/io/flutter , https://storage.googleapis.com/download.flutter.io/ (all of them followed by flutter_embedding_profile/maven-metadata.xml or armeabi_v7a_profile/maven-metadata.xml). Literally none of them worked; in the end, I had to copy a template from the first maven-metadata.xml that I could find (I chose https://repo.maven.apache.org/maven2/io/accumulatenetwork/accumulate-java-sdk/maven-metadata.xml), create the flutter_embedding_profile-maven-metadata.xml and armeabi_v7a_profile-maven-metadata.xml files, paste the templates, change the plugin names and match the versions with the actual ones (1.0.0- I recall) and then place those files where they belonged in the engine. Here are those It finally compiled, and to my surprise: |
I am not sure whether that's the correct way... IIRC, they were auto downloaded.
I guess it is because your downloaded file? Dart is sensitive to versions, e.g. if you download a file built with Dart version A, while you are using Dart version B, it errors. |
Hi again! I have no idea why, but in my case they are not downloaded automatically. Pretty weird. Could you confirm that on macOS (in your case) the files (under the path engine/src/out/) armeabi_v7a_profile.jar, armeabi_v7a_profile.maven-metadata.xml, armeabi_v7a_profile.pom, flutter_embedding_profile.pom, flutter_embedding_profile.jar and flutter_embedding_profile.maven-metadata.xml (in their profile, debug or release versions) are automatically downloaded?
I tried with other versions of those files (also downloaded from https://storage.googleapis.com/download.flutter.io) and no difference, still the same error. However, I followed this guide https://github.com/mildsunrise/darter/blob/master/info/versions.md to find the dart sdk kernel snapshot version and effectively the sdk snapshot version of the custom engine is On the other hand, I just saw that adding the flag Btw, I am able to successfully run the app with the custom engine and framework on Windows. It is utterly impossible on Android (this is what I'm currently trying). Anyway, if you have any idea on how to approach the issue, please let me know. Again, thanks for your help and support :) |
Hmm I have no idea. Another way may be to migrate this branch into latest flutter master, since google's infra may be unhappy about the old code? I have not been working on this for a while, so cannot verify that auto-download thing (my environment is already switched to other branches near flutter master and they work well) |
Hi again! The migration seems like a good idea. I have also been able to build the custom engine for arm64 on android, however at the time of running I get the error On the other hand, after doing a little bit of research I have been able to do some reverse engineering on the flutter app I'm trying to run with the custom build. After opening the apk and inspecting the "libflutter.so" file, I found that the app is using the dart 3.1.0-54.dev sdk version, which has absolutely nothing to do with the custom flutter framework nor any other dart sdk versions I have installed in my machine. Precisely, dart 3.1.0-54.dev yielded the snapshot hash It seems as if flutter had picked that dart sdk version randomly, it makes no sense; the custom flutter framework dart sdk I have is 2.19 dev, as I said 3.1.0-54.dev is not related at all with anything I have installed on my computer. Extremely weird, please tell me if you know anything about this. Btw, would it be possible to do the branch migration for both the engine and the custom framework? Thanks for your help and amazing work. |
Ah again it looks like Flutter infra problem (as I said above, maybe they only support latest version?)
I am not very sure. Flutter code is changing really rapidly! But you can have a try :) |
Hi again! Thanks, could you give me a hint on how to do the migration? I'm not really sure how to go about it |
Just try to merge flutter's master branch into my branch. However, I guess that can be time consuming. So before starting, I have to make some warning:
However, if you successfully migrated, I would like to hear your benchmark results! Because theoretically my solution should yield full-FPS smooth result IMHO, so I am happy to know more experimental results. |
Thanks! I will give it a try. I am also going to try to build it on macos (I dont have that much storage left on that machine, but enough to build the engine) and will post an update if it works. I really hope it does. |
You are welcome, and looking forward to your results!
To be honest, it cannot be determined by me. This repository already shows code that yields smooth results (all theoreical and experimental results are in the doc), but in order to make it production ready, all engine PRs have to be merged into official Flutter. That is really hard. IMHO, Flutter Googlers are very very careful about making nontrivial changes to the engine. I can totally understand them, because they have to ensure e.g. it is compatible with every existing cases, can be extended in the future, etc. However, that makes it not very easy to make PRs necessary for this repo to be merged. |
Hi again! I was finally able to build and run an app with the custom engine and framework build; using MacOS did the trick, I only had to add the |
Wow great! I have known windows can have some trouble and macos is eaiser since it is more *NIX-like, but do not know it can be this hard. Looking forward to your results! By the way, I did not have videos (SurfaceView/TextureView?) in mind when developing this - I was thinking about widget trees (the common case). Then I am more curious about the experimental results - these native views are very special, will Smooth work on them? |
Hi again! Sorry for being inactive all these past few days, unfortunately I've been sick and was not able to work too much on this. I have built an example app with two video list views that shows them side by side: the first one plain, the other one smooth. One issue I have observed is that after scrolling the smooth listview for a few seconds, the app often crashes (though it doesn't close). I believe it'd also be worth looking a little bit into this. (Just in case for anybody else interested in trying it out, the local path route for libraries is /Users/user/, change it to your local installation of sky_engine and flutter smooth) Thank you very much again for your help and support, and I hope we're able to find a solution to this since nobody on the Internet has seemingly been able to fix it. PD: I won't be able to use a computer for the next 12-14 days since I'm going on holiday, although I think I'll be able to answer questions from my phone that do not require direct programming Thanks again :) |
Sorry to hear that you are sick, and I do hope you are getting well!
Hacking engine is like that... My code is experimental and only test on devices I own, since my PRs are not merged to flutter yet. When they are getting merged, the code will be run on Flutter's CI, which covers a ton of devices and edge cases, and thus it should be much much more stable, at least will not crash like this. In addition, I have not had platform native views in my mind when designing this lib (since I personally do not use them, and when I go through the journey of solving the task nobody pointed me out about this).
If it is not a build/layout jank, then as is stated in this repo, flutter_smooth will not help to be smoother. The build/layout jank is a very common source of jank (see the doc), but is definitely not the only one. For your case, I guess you can firstly use the stable Flutter channel to check a bit more about the jank problem. If both UI and raster thread is happy, but it is jank, maybe create an issue at Flutter repo? Without details, I guess it is something related to how native views are rendered together with flutter views. For example, is the platform thread (the Android main thread) somehow stuck? You may also need a native Android profiler (in Android Studio) to check what's going on. In addition, the devtool ui is sometimes misleading. For example, I have personally seen that (though not your case), if you run toImage() for heavy resources, the frame claims it is under 16ms and thus "smooth", but the toImage blocks the thread for a long time and you do see jank.
You are welcome! And have a nice holiday :) |
Thanks, I am recovering a bit slowly but getting better over time :).
I understand, usually there are few use cases of them.
Yes, I guess I'll do it when I'm back from vacation. Thanks for the suggestion :).
It definitely seems like it is something related with how native views are handled by flutter, as you say. When I tried to modify the video player's library native layer (in kotlin), I removed the
I noticed after a few tests, it often doesn't yield accurate results.
Wow, that is surely something the flutter team should look into. A bit upsetting they don't cover these kind of cases.
Thanks so much! I'll notify when I'm back. Have a nice rest of the day! |
Hi again! After a few days, I finally opened the promised issue at the official flutter repo: flutter/flutter#132675 |
@jmquilez Btw, how is the result of |
Hey again @fzyzcjy! Sorry for not answering earlier. As for the profiler results, I have been testing the app and it looks like the android performance view shows janky frames that actually match what I see on the app, unlike the dart devtools performance view. However, at the time of using the android profiler, following this guide: https://developer.android.com/studio/profile/jank-detection?hl=es-419 and after recording a I have tried updating my Android Studio installation (I had Arctic Fox, now it's Giraffe, the latest version) and still, I get no information at the |
Looks great!
I also sometimes see profiling results are incomplete... So some possibilities may be:
Or, maybe Flutter does not yield You are welcome! |
Hi @fzyzcjy indeed it seems to be the last reason you provided
I have profiled both a react native app and a native android app on Android Studio and in both cases the
And for flutter it's the same picture I provided yesterday. I have also tried running the app on a different device (Samsung A51, with Android 10) and instead of nothing it shows a horizontal grey bar in the It also seems weird to me that the
I have seen Again, thanks so much for your attention and help, I truly appreciate it :). |
Update:
I forgot to attach a picture about this, here it is: This is basically the same as @matthew_carroll mentioned here: flutter/flutter#127276 (comment), and from what I've read so far this problem might be related to latency. I'm going to continue reading that issue and might comment this particular case there, in case they are interested in testing it and confirming it is all related to the same problem. Still, without being able to see frame data from Android Studio (as shown in the picture above) it is quite uncertain to determine the actual cause of the jank. |
Just commented on the issue, seems like they are open to discuss new ways to measure jank on the devtools flutter/flutter#127276 (comment) |
Describe the bug
I used a custom engine and a custom Flutter, but there was an error during compilation. I can't find the reason
Error: No named parameter with the name 'forceDirectlyCallNextVsyncTargetTime'.
Error: Member not found: 'PlatformDispatcher.pointerDataPacketStorageReadPendingAndClear'.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: