jwinarske / meta-flutter

Yocto meta layer for recipes related to using Google Flutter Engine
MIT License
45 stars 22 forks source link

Regarding flutter-pi_git.bb #29

Closed octonout closed 3 years ago

octonout commented 3 years ago

Hi. I was able to get flutter-pi set up correctly and run flutter apps. Although I had to make the following changes to the flutter-pi recipe in a .bbappend:

SRCREV = "${AUTOREV}"

unset RDEPENDS

RDEPENDS_${PN} += "\
    fontconfig \
    liberation-fonts \
    ttf-liberation-sans-narrow \
   "

Unsetting and setting RDEPENDS with _${PN} helped to solve a bitbake error Variable RDEPENDS is set as not being package specific, please fix this. Maybe you could fix this in the .bb.

And the issue of apps not responding to any touches was solved by making the recipe use the latest commit using ${AUTOREV}

Also, added the liberation-fonts and ttf-liberation-sans-narrow packages as without these, no text was visible in flutter apps.

Btw, I was wondering why the flutter-pi recipe is set to use an old commit. The image built fine with the latest commit.

jwinarske commented 3 years ago

@octonout I just rolled the recipe commit to tip of the tree. AUTOSRC is handy when there's churn, but releasing with AUTOSRC is a bad idea. So my feeling is to roll only when there's some test coverage. In this case, you!

Before I add the fonts I need to take a closer look at the code. Normally the font is loaded as an asset as part of the bundle, opposed to having a hard system dependency. The Gallery app isn't showing text without these fonts installed?

Thanks!

jwinarske commented 3 years ago

I went ahead and added fonts as a runtime dependency for now. Thanks again.

octonout commented 3 years ago

The Gallery app isn't showing text without these fonts installed?

I should have been clearer in my post. I didn't get to fully test the Gallery app without the fonts installed. When I had the issue where I the app was freezing / not responding to any touches, I couldn't move around in the Gallery app. The only part that was visible on screen was a part of the home page. And iirc, the text was displayed correctly. I am sure that the menus for Categories, the Material and Cupertino ones showed the Material and Cupertino text on them.

I had built some apps using ardera's guide in the flutter-pi readme. So basically, I built the asset bundle, kernel snapshot and the app.so manually. I used the dart sdk that I had installed on my host for it. And used the gen_snapshot provided by ardera in his engine binaries repo. Also picked up the icudtl.dat and libflutter_engine.so from there.

I made two apps in this way. One was the default app with the + button that increments the counter in the middle of the screen. And another was the one where it gives you infinite word pairs on scrolling. In both these apps, no text was visible. Be it the app title or the increment counter or the word pairs in the listview. In this issue I had opened on flutter-pi, ardera suggested to figure out whether the Arial font was installed. It wasn't, and installing the liberation-fonts and ttf-liberation-sans-narrow packages fixed it.

I went ahead and added fonts as a runtime dependency for now. Thanks again.

Glad to have been of help. :smile:

jwinarske commented 3 years ago

@octonout Okay that lines up with what I thought.

Then what you will want to do is create a recipe for your app (copy the gallery recipe), and add the font as a dependency there. I will remove the font dependencies on flutter-pi as such.

In the case of the development workflow, yes as long as the engine version matches the host SDK everything will work.

The flutter channel generally rolls every week, so if using Yocto build to generate a new image after a roll, then you need to follow the sequence I mentioned prior to "reset the build" (clean caches and rebuild).

I appreciate your detailed descriptions of everything. It helps narrow in on things much quicker. If only everyone did that ;)