Skip to content

Instructions for building the asset bundle #57

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

Closed
chetrf opened this issue May 6, 2020 · 4 comments
Closed

Instructions for building the asset bundle #57

chetrf opened this issue May 6, 2020 · 4 comments

Comments

@chetrf
Copy link

chetrf commented May 6, 2020

Thanks for making this available to everyone. I seem to be stuck on how to build the asset bundle. You call out the need to use a flutter SDK that is compatible with the engine version you are using. I am going to attempt to use the engine from your engine-binaries branch. Do I install a compatible SDK on my regular computer, build the assets bundle, and them move them to the Pi? Can you point me to info that would help me take that step? Again thanks very much.

@ardera
Copy link
Owner

ardera commented May 6, 2020

Do I install a compatible SDK on my regular computer, build the assets bundle, and them move them to the Pi?

Exactly

Can you point me to info that would help me take that step?

Unfortunately, there's not that much info about that. I found this (though he uses a flutter-pi fork instead of vanilla flutter-pi)
So here are some rough steps:

  1. install flutter using the instructions on the webpage
  2. if you're using windows: install SSH using these instructions
  3. it's best you setup public-key authentication using these instructions, so you don't have to enter your Pis password every time you transfer an asset bundle
  4. open the command line / terminal and enter cd <the path to your app directory>. Keep in mind you need to surround the path in quotes if it contains spaces. So for example, cd C:\Users\Test\Desktop\flutter_test\ would be a possible command.
  5. from this point on you can follow the instructions on the page I mentioned, starting from the second command.
  6. (for running flutter-pi on the target, just run flutter-pi ./flutter_assets or sudo flutter-pi ./flutter_assets if you are getting an error without sudo)

EDIT: forgot the word fork in one place

@chetrf
Copy link
Author

chetrf commented May 6, 2020

OK, very helpful feedback. Will give this a go. Thanks very much.

@chetrf
Copy link
Author

chetrf commented May 7, 2020

So very cool! it is working.

For the benefit of others, here are few more details that I did not understand at first:

I followed your directions on the engine-binaries branch to get your prebuilt binaries.
After moving the .h and .so files per the instructions on that branch I deleted the cloned flutter-pi directory.

Then I cloned your master branch to create flutter-pi again. Then I cd'd into flutter-pi and ran make.

After that I edited my .profile file and added the flutter-pi executable to my path.

I already had a garden variety flutter SDK install on my Mac. I made sure I had a working app as tested in an iOS simulator.

Then I patched the app in my main.dart file per your instructions.

Then inside my flutter app directory on my Mac I ran "flutter build bundle"

Then I used scp to copy over the build/flutter_assets directory.

Then at the command line on my pi I ran

flutter-pi /home/pi/flutter_assets/

and it all jumped to life and is working. I have 4 buttons on my simple app and they all seem to work nicely with the standard pi 7 inch touchscreen.

Also in case anyone is curios, I am using the latest Buster Lite version of Raspian.

This is sooo cool! You are awesome for putting this out there for others. Thank you. Now I can dev away on my computer. When I am happy with my app just build the asset bundle and push it on over and run it on the pi.

@ardera
Copy link
Owner

ardera commented May 7, 2020

Thanks! I'm glad it worked!

@ardera ardera changed the title How to build asset bundle Instructions for building the asset bundle May 7, 2020
@ardera ardera pinned this issue May 7, 2020
@ardera ardera closed this as completed Jun 9, 2020
@ardera ardera unpinned this issue Aug 5, 2020
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

No branches or pull requests

2 participants