'Build input file cannot be found in Xcode 12.5.1

I am using m1 mac machine, Now I am getting the below error.

Tried:

I have added erm64 and x86_64 in the Excluded Architechtures. But still it fails with the below error.

If I change the Build System to New Legacy Build(Deprecated) it not works. Deleted the derived data and cleaned the project and rerun the app it not works. Also created VALID_ARCHS and added arm64 and x86_64 for local build and archive build. (Now i have deleted this)

Build input file cannot be found in Xcode 12.5.1

error: Build input file cannot be found: '/Users/jesphin/Library/Developer/Xcode/DerivedData/app-acbwzzdkvazcpfbaiyudpfvlkwyv/Build/Products/Debug-iphonesimulator/App News.app/App News' (in target 'App' from project 'App')


Solution 1:[1]

I had exact same error message. I was able to run the project on simulator. But when I try to Product > Archive in order to submit to App Store Connect, I was given the error message.

For my case, removing extra folder that was not needed in "Development Assets" fixed the issue. I had the main folder of the app listed there for some odd reason. Deleted that and it allowed me to archive.

App > Targets > General

enter image description here

Solution 2:[2]

The build cannot be found error resolved for me in mac m1 for my case.

Add arch in the Framework which shows the error in the xcode.

Build on simulator:

  1. Add arm64 in Exclude arch of the Target Add arm64 arm64e i386 x86_64 in valid archs of the target

  2. Add Valid_Archs as x86_64 in the framework which shown the error

    Archive Build:

  3. Add x86_64 in Exclude arch of the Target.

  4. Add arm64 arm64e i386 x86_64 in valid archs of the target.

  5. Add Valid_Archs as arm64 x86_64 in the framework which shown the error

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 jkim
Solution 2 sejn