Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 12: Compiling for iOS 10.0, but module 'RxSwift' has a minimum deployment target of iOS 12.0

I just updated Xcode to the latest version, and the project is no longer compiling. I removed everything and tried to rebuild pods but ended up having the same issue this issue:

[x] /Users/alouanemed/Projects/App-iOS/Pods/_Prebuild/Moya/Sources/RxMoya/MoyaProvider+Rx.swift:2:8: compiling for iOS 10.0, but module 'RxSwift' has a minimum deployment target of iOS 12.0: /Users/alouanemed/Projects/App-iOS/Pods/build/Release-iphoneos/RxSwift/RxSwift.framework/Modules/RxSwift.swiftmodule/arm64-apple-ios.swiftmodule

import RxSwift ^

like image 394
Mohamed ALOUANE Avatar asked Sep 19 '20 09:09

Mohamed ALOUANE


People also ask

How do I change the minimum deployment target in Xcode?

To change your deployment target, open up your project file in Xcode and check the setting under Build Settings -> Deployment(...) Check this answer to add earlier devices support.

What is iOS deployment target in Xcode?

In short, every application that runs on one of Apple's platforms has a deployment target. A deployment target is nothing more than the minimum version of the operating system the application can run on. Fire up Xcode and create a new project by choosing the App template from the iOS > Application section.

How do I change the deployment target simulator?

Click on pods. Select each project and target and click on build settings. Under Deployment section change the iOS Deployment Target version to anything more than 8.0 (better to try the same project version). Repeat this for every other project in your pods then run the app.

Does Xcode 12 support iOS 8 on-device debugging?

The release notes for Xcode 12 beta state that the release “supports on-device debugging for iOS 9 and later, tvOS 9 and later, and watchOS 2 and later.” I am not sure if that means support for building and deploying for iOS 8 is completely removed, but it sounds like it.

What is the iOS simulator deployment target for CocoaPods with Xcode 12?

If you are using CocoaPods with Xcode 12 beta, then you have probably seen this error: 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.

What is the iOS simulator deployment target for iOS 8?

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 is happening because support for iOS 8 has been dropped, but the minimum deployment target for the pod is iOS 8.

Why are my CocoaPods failing to deploy to iOS 8?

This is happening because support for iOS 8 has been dropped, but the minimum deployment target for the pod is iOS 8. This older GitHub issue on CocoaPods discusses this a bit, as well as this recently opened issue. Note that even if your minimum deployment target is greater than iOS 8, you will still see this error.


3 Answers

With cocoapods and Xcode 12, you currently need to set your Pods' deployment targets in a so-called "post-install hook".

Try adding this to the end of your Podfile:


deployment_target = '12.0'

post_install do |installer|
    installer.generated_projects.each do |project|
        project.targets.each do |target|
            target.build_configurations.each do |config|
                config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = deployment_target
            end
        end
        project.build_configurations.each do |config|
            config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = deployment_target
        end
    end
end
like image 140
Gereon Avatar answered Nov 15 '22 07:11

Gereon


Just to people who may end up in the same case as me. The reason of this error was that I was using the beta channel. After switching to the stable channel, I ran

cd ios/
pod deintegrate
pod cache clean --all
cd ..
flutter clean

And, I removed the Podfile and the Podfile.lock. Then, I built the project again and it worked!

like image 45
Andres Naranjo Avatar answered Nov 15 '22 07:11

Andres Naranjo


You are tying to import a version of RxSwift that has already set its minimum deployment target to iOS 12.0 while your project itself is still on iOS 10.0.

This should not be related to Xcode or the Xcode update.

If you can post your Podfile we can verify this.

like image 37
Dominic Frei Avatar answered Nov 15 '22 07:11

Dominic Frei