1

This is the error I get when I try to build my Flutter app with Xcode 12.5.1. I can run the app on the Simulator without any problem, my friend with an Intel MacBook Pro can build it but I can't with my M1 processor.

After trying many things on my main project, I've decided to build an empty project in order to know where the problem was. And I still have the same error when I try to build a just created project.

I have noticed this line in the build target runner logs : export arch\=undefined_arch
Of course I have followed several topics about excluded architectures without success.

I once saw a topic that told to change the Build System to Legacy in the Workspace Settings. After doing that, I have an other error I can't resolve : Command /bin/sh failed with exit code 1, but the export arch is now set to armv7.

I absolutely don't know why I can't build even a new Flutter project on my M1 Mac. Is it a problem with this undefined architecture ?

Here is more information about my configuration :

Flutter doctor
New Build System logs
Legacy Build System logs

1 Answers1

0

I had the same error, you need to reinstall flutter on your device. Just remove the sdk folder or if you want to clean correctly you need to do that in you Flutter install directory :

git clean -xfd
git stash save --keep-index
git stash drop
git pull
flutter doctor
Simats
  • 14
  • 1