Chapter 19 with the SDK API 32 of Jan 2022 and Mac M1

In Chapter 19, in “Setting up iOS”, my very first build failed with the message

    ** BUILD FAILED **
Xcode's output:
↳
    diff: /Podfile.lock: No such file or directory
    diff: /Manifest.lock: No such file or directory

I’m using the Android SDK API 32 (brand new), Xcode 13.1, Android Studio 2020.3.1 Patch 4, on a MacBook M1 running macOS 12.1.

In Xcode I noticed that the project Pods is missing (Xcode shows it in red), as well as the files *.xcconfig of project Runner, folder Pods.

After searching on Stack Exchange, I noticed that in Xcode, project Runner, target Runner, tab Build Settings, there are missing 2 environment variables: PODS_ROOT and PODS_PODFILE_DIR_PATH. Because of this, in the build phase Check Pods Manifest.lock, the process fails to find the files Podfile.lock and Manifest.lock and cannot compare them, thus making the build fail.

I suspect that the courseware has been tested with an older version of the SDK than API 32, and therefore this new release (issued this month) breaks the sample project starter

The solution is simple and harmless. I share it here in case it might help someone working on macOS 12.1, Xcode 13.1, Mac M1:

  • in Terminal, cd to the folder starter/iOS
  • run the shell command: pod deiterate
    this commands deletes all pod files from the project and all references to them in build phases
  • run the shell command: pod install
    this command reads the Podfile for dependencies, creates the project Pods, integrates the pods into it and create the missing environment variables.

After that, in Android Studio, the starter project builds and runs fine on a simulated iPhone 13.

Now I can continue the lesson in chapter 19.

Note: I use a ARM64 CocoaPods built with a local Homebrew’ed version of Ruby, made specially for the M1 chip. See explanations in A surprise when moving to a Mac M1 | by Khang Vu Tien | Medium

Thanks for the heads up and solution, here. The whole toolchain version changes has one of the biggest pains throughout the whole process, and I hope that the dev experience will continue to improve over time.

1 Like

The book is of high quality. I learned a lot about Dart, Flutter, Android Studio, Play Store, App Store and Xcode. I started knowing nothing about them.

Thank you for making the book available free.