Setting up for Amplify Mobile Development

This won't be anything elaborate, but I'm working my way through Adrian Leung's excellent "Rapid Application Development with AWS Amplify" and thought it might be useful to capture a few notes on setup prerequisites I discovered on my personal 12.5.1 MacOs machine. In case anyone else has the same configuration needs on their machines - hopefully this will help.

Expo Apps

I tried the Expo apps first.

iOS

The important thing to know here is that, if you didn't already have xCode installed, besides installing it, you have to actually start it up once before trying to do the Expo app with it. The latest version of xCode does a bunch of stuff on its first run that you need to have done before trying to run "yarn ios".

Android

The big thing for me here was that I chose to emulate a Pixel 4a (since that's the kind of phone I own) and it turns out that the defaults on storage are not large enough. I had to bump both the internal storage and mem card storage (both emulated, of course) to 4098 MB using the Advanced Settings for the emulator.

Another thing is that here I had to do "sudo yarn android" instead of just "yarn android".

Last but not least, I got a dialog the first time I ran it complaining that the emulator file wasn't signed properly. I had to launch Settings, then go to Security and hit a button that was specifically added to that dialog to allow the emulator executable to run.

No alt text provided for this image

Web

The only thing that happened here was that when I first tried running "yarn web" it told me that some prerequisites were required. It gave me exactly the command line to run to execute them. I did that and everything worked fine.

ReactJS

This worked first time without any changes required.

React Native

When I ran "yarn ios" the first time without the emulator running, it gave an error. When I re-ran the command with the emulator running, there was no error. However, it took a really long time to actually build the application (over 10 minutes - whereas every app type up to this point took less than a minute).

When I ran "yarn android", it absolutely refused to run on the emulator I had up-and-running still in Android Studio. So, I launched an instance from the command console and tried deploying to that. This also failed, so I looked at the errors. They were all complaining about not being able to find certain binaries associated with Android. I wound up having to add the following environment variables...

  • To PATH, added /Users/my-username-here/Library/Android/sdk/
  • To PATH, added /Users/my-username-here/Library/Android/sdk/emulator/
  • To PATH, added /Users/my-username-here/Library/Android/sdk/platform-tools
  • Added ANDROID_HOME, with value /Users/my-username-here/Library/Android/sdk/

Adding these fixed everything in the stand alone emulator, and then - when I retried it in the emulator in Android Studio... it all worked there, too!

要查看或添加评论,请登录

Derek Ferguson的更多文章

  • Fixing Mobile Tools when Flutter Doctor complains, V2

    Fixing Mobile Tools when Flutter Doctor complains, V2

    (This is an amendment to a previous article I published. New computer = new understanding of old problems as I go…

  • Notes on Creation of NFTs

    Notes on Creation of NFTs

    I recently created an NFT following the instructions in this excellent tutorial. I had to make some adjustments as I…

  • Hackathon 2021: World Innovation Day

    Hackathon 2021: World Innovation Day

    This year, Hackmakers hosted a global hackathon in support of the UN's sustainable development goals. My employer…

    2 条评论
  • Hackathon - Testing the Environment

    Hackathon - Testing the Environment

    This week, technologists from around the world will be participating in a Hackathon in support of the United Nations'…

    1 条评论

社区洞察

其他会员也浏览了