material-components-ios
material-components-ios copied to clipboard
[Component] Xcode 12 build error
I was trying to run my project with Xcode 12 Beta 6 but it fails building, the compiler gives me this error:
Undefined symbol: _MDMMotionCurveMakeBezier
I tried to clean cache, deintegrate pods and reinstall them but with no success.
Here is a detailed description of the error:
Undefined symbols for architecture x86_64: "_MDMMotionCurveMakeBezier", referenced from: +[MDCActivityIndicatorMotionSpec loopIndeterminate] in MDCActivityIndicatorMotionSpec.o +[MDCActivityIndicatorMotionSpec willChangeToDeterminate] in MDCActivityIndicatorMotionSpec.o +[MDCActivityIndicatorMotionSpec willChangeToIndeterminate] in MDCActivityIndicatorMotionSpec.o +[MDCActivityIndicatorMotionSpec willChangeProgress] in MDCActivityIndicatorMotionSpec.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
Steps to reproduce the behavior:
It happens every time I try to build the project on iOS 14 and Xcode 12, with XCode 11.6 and iOS 13.6 I have no problems at all.
Platform (please complete the following information)
- Device: iPhone Simulator
- OS: 14.0 beta 6
The title doesn't have a [Component] prefix.
@AndrexOfficial I'm guessing you have an iOS deployment target specified in the post_install step of your Podfile. A temporary solution would be to remove this line for now:
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
(could be another version in your file)
This leads to Xcode Build Warnings however:
The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99.
This warning will have to be fixed by CocoaPods itself: https://github.com/CocoaPods/CocoaPods/issues/9884
@AndrexOfficial I'm guessing you have an iOS deployment target specified in the post_install step of your Podfile. A temporary solution would be to remove this line for now:
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
(could be another version in your file)This leads to Xcode Build Warnings however:
The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99.
This warning will have to be fixed by CocoaPods itself: CocoaPods/CocoaPods#9884
https://github.com/CocoaPods/CocoaPods/issues/9884#issuecomment-700895329
It looks like this is not going to be fixed in CocoaPods and it should be done by updating the deployment_target in the Podspec,
Hopping over from that thread in CocoaPods, I think you might have a crossed wire here. CocoaPods is indeed not going to update the deployment target for pods automatically, as it can cause build failures and they've decided a rare failure is worse than common warnings.
But, I don't think you would run into that issue here? The podspec for this pod already targets iOS 10+, which should be recent enough to not cause a warning. (Though, I suppose, a dependency further up the chain might be still targeting iOS 8...)
@maxcruz was there a reason you added the iOS 13 override to your post install script? @AndrexOfficial do you know which pod would cause the 8.0 warning if that override were removed?
Also adding @rene-dohan's code snippet over in that thread, which does a more surgical job of updating outdated CocoaPod targets to avoid the iOS 8 warning:
post_install do |pi|
pi.pods_project.targets.each do |t|
t.build_configurations.each do |bc|
if bc.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] == '8.0'
bc.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
end
end
end
end
I'm on XCode 13.1 and still running into this issue regardless of what I do or don't know in the post_install
hook - I've tried not doing anything, forcefully setting all pods' deployment targets to 11, selectively setting the ones whose deployment target is 8 to 9, changing the platform
directive at top of my file from 11 back down to 10. Nothing seems to help. Can anyone explain how exactly the deployment target is causing this particular symbol to not be found?