Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Xcode 12 dylib error #487

Closed
MarcoCarnevali opened this issue Sep 29, 2020 · 14 comments
Closed

Xcode 12 dylib error #487

MarcoCarnevali opened this issue Sep 29, 2020 · 14 comments

Comments

@MarcoCarnevali
Copy link

Steps to reproduce

  1. Use Xcode 12.0 or later
  2. install Mapbox SDK v6.2.1 using CocoaPods
  3. build the app

Expected behavior

No errors

Actual behavior

Can't build this is the error preventing it:
building for iOS, but linking in dylib file (/Users/marcocarnevali/Library/Developer/Xcode/DerivedData/<AppName>-ackcfwuxqhtmbgcrnvtojbpyrrnk/Build/Products/Release-iphoneos/MapboxCommon.framework/MapboxCommon) built for iOS Simulator, file '/Users/marcocarnevali/Library/Developer/Xcode/DerivedData/<AppName>-ackcfwuxqhtmbgcrnvtojbpyrrnk/Build/Products/Release-iphoneos/MapboxCommon.framework/MapboxCommon' for architecture arm64

Configuration

Mapbox SDK versions: 6.2.1
**iOS versions: 14.0 **
Device/simulator models: every iPhones
Xcode version: 12.0

@captainbarbosa
Copy link
Contributor

Hi @MarcoCarnevali - I think this will be addressed by #482.

In the meantime, if you could provide the exact version of CocoaPods and Xcode you're using that would be helpful. Thanks!

@MarcoCarnevali
Copy link
Author

@captainbarbosa my CocoaPods version is: v1.9.3 while Xcode is version 12.0.
My problem seems to be quite the opposite. Excluding arm64 let me build for the simulator but I still can't build for my devices either with arm64 excluded or not.

@ZiZasaurus
Copy link
Contributor

ZiZasaurus commented Sep 29, 2020

@MarcoCarnevali, if you set the build settings to Any iOS simulator instead of Any SDK does it allow you to build to devices? I ran across a similar issue when testing.

Screen Shot 2020-09-29 at 6 33 07 PM

@MarcoCarnevali
Copy link
Author

@ZiZasaurus this is what I have but I still can't build for the device
Schermata 2020-09-30 alle 14 37 51

@MarcoCarnevali
Copy link
Author

I fixed it following this: mapbox/mapbox-navigation-ios#2674

@DusanEastcode
Copy link

hello everyone, can you please fix the settings here in these examples? https://github.com/mapbox/navigation-ios-examples settings (excluded architectures) mentioned here doesn't work for me.

@noway
Copy link

noway commented May 23, 2021

Can this please be reopened? This still happens on Apple Silicon M1

@ManthanSutariya
Copy link

still facing this issue on mac m1

@korczis
Copy link

korczis commented Aug 5, 2021

Same here

@felix-ht
Copy link

felix-ht commented Aug 18, 2021

getting the same issue but only building for the simulator

ld: building for iOS Simulator, but linking in dylib built for iOS, file '/Users/felix/code/dynamic-forest/ios/Pods/Mapbox-iOS-SDK/dynamic/Mapbox.framework/Mapbox' for architecture arm64

@felix-ht
Copy link

adding this to the podfile fixed this for me in flutter on an m1 mac

post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end
end

@samoray1998
Copy link

samoray1998 commented Jun 22, 2022

add. this in Podfile

  projects = installer.aggregate_targets
    .map{ |t| t.user_project }
    .uniq{ |p| p.path }
    .push(installer.pods_project)
    installer.pods_project.targets.each do |target|
      flutter_additional_ios_build_settings(target)
    end

  projects.each do |project|
    project.build_configurations.each do |config|
      config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
    end

    project.save()
  end
end

@sharon-atim
Copy link

Add this to the Podfile.

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
end

@sryze
Copy link

sryze commented Dec 24, 2022

How is adding arm64 to EXCLUDED_ARCHS a solution? It forces the app to be compiled for x86_64 instead of ARM64 and the simulator runs through Rosetta as a result. This is not efficient.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests