I am working on a flutter app for iOS, using Mac mini with Apple M1.
The app worked fine on the simulator and real device until today, when I updated Xcode to 15.0.
Now, I cannot run on a simulator or a real device, getting the following error:
Could not build the precompiled application for the device.
Error (Xcode): 2 duplicate symbols
Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation)
Error launching application on XXXXXX’s iPhone.
Instead of the above error, I sometimes (randomly?) get the error described here.
What I tried:
- Verified with Flutter Doctor everything is OK (initially, the Xcode installation did not complete, missing the command line tools, but I fixed that)
- Upgraded flutter (3.13.6)
- Updated cocoa pods (1.13.0), (as instructed here, this fixed an earlier error I was getting
DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead
) - Cleared the Xcode cache (as instructed here), deleted flutter sub-folders & files (.symlinks, Pods, Podfile.lock, pubspec.lock) and reinstalled pod (as instructed here), and ran flutter clean
- Uninstalled and reinstalled Xcode
- Created a new user on the Mac, installed Xcode and flutter from scratch, and cloned my app’s Git repo from scratch
- Tried building another ios app
Unfortunately, none of these resolved the error described above.
Any help or ideas would be most welcomed!
2
Answers
I have done the following, and I guess one or more have resolved this:
Cycle inside Runner; building could produce unreliable results. Cycle details: → Target 'Runner': ExtractAppIntentsMetadata ○ Target 'Runner' has copy command from
, so I in Xcode>Targets>Runner>Build Phases, I dragged "Embed Framework", "[CP] Embed Pods Frameworks", and "Embed App Extentions" to be before "Run Script" as instructed hereI can now build and run the app using Xcode 15 on a real device (iOS 16.7). Haven't tried yet on a simulator
Please make this changes on your project
Open Project in Xcode –
Update this line
Existing –
source="$(readlink "${source}")"
New –
source="$(readlink -f "${source}")"