The linked framework 'Pods_Runner.framework' is missing one or more architectures required by this target: x86_64. problem [duplicate]

I was getting this error when running a simulator. (Using MacBook M1 pro)

the error message pic

I trying to fix by adding i386 and arm64 to the exclude architect on Xcode but this error message still remain

the Xcode workspace setting pic

Thanks.

PS. Yesterday it was running properly without any error, but somehow when I save the code then run it again the error occurs.


First, flutter clean and delete your podfile.lock and then goto your terminal and run those commands.

flutter pub get

Then, try this

cd ios && arch -x86_64 pod install && cd ../