skip to Main Content

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:

  1. Verified with Flutter Doctor everything is OK (initially, the Xcode installation did not complete, missing the command line tools, but I fixed that)
  2. Upgraded flutter (3.13.6)
  3. 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)
  4. 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
  5. Uninstalled and reinstalled Xcode
  6. Created a new user on the Mac, installed Xcode and flutter from scratch, and cloned my app’s Git repo from scratch
  7. Tried building another ios app

Unfortunately, none of these resolved the error described above.

Any help or ideas would be most welcomed!

2

Answers


  1. Chosen as BEST ANSWER

    I have done the following, and I guess one or more have resolved this:

    1. Created a new user on the Mac
    2. Installed Xcode and Flutter from scratch, as instructed here
    3. Still got duplicate symbols error. So tried to downgrade the iOS, which failed and thus forced me to restore to factory settings
    4. Set other link flags add "-ld64", a instructed here
    5. Now I was getting another error 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 here

    I can now build and run the app using Xcode 15 on a real device (iOS 16.7). Haven't tried yet on a simulator


  2. Please make this changes on your project

    Open Project in Xcode –

    • go to POD section
    • Open Target Support Files
    • Open Pod-Runner
    • Open Pods-Runner-frameworks

    Update this line

    Existing – source="$(readlink "${source}")"

    New – source="$(readlink -f "${source}")"

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search