This article describes the possible reasons and respective solutions for the “SDK version unrecognised” error.
Whenever the Futurae mobile SDK communicates with the Futurae backend, it appends an HTTP header containing the mobile SDK version details. Any request containing an invalid or unexpected SDK version reported in that header, will be rejected with the HTTP status 400 Bad Request, and the error message “SDK version unrecognized”.
Why is this error happening now?
Xcode 13 introduces a new feature to manage the version and build number for the app and its third party dependencies. This feature automatically increments the app versioning when submitting it to the App Store.
The automatically set build number does not match the SDK versioning format accepted by the Futurae backend, which in this case would make the requests towards the backend to be rejected with this particular error.
The solution to prevent this may vary depending on whether you are building your app manually or using any kind of CI/CD tool.
Manual Build
When manually building, the option “Manage Version and Build Number” must be disabled in order to prevent Xcode from automatically incrementing the build number. By doing so you will ensure that the SDK version value will be managed by the Futurae Mobile SDK itself.
CI/CD tools
Whenever using a CI/CD software it’s important to consult the respective official documentation, since different tools support distinct ways to instruct Xcode to not manage the version and build number.
Additionally, there’s a viable alternative for cases where your CI/CD tool does not support any mechanism to disable the automatic version and build number. Together with this feature, Xcode 13 introduced a new variable named manageAppVersionAndBuildNumber which can be set as false, thereby disabling Xcode’s auto versioning and build number feature.
The following steps explains how to do it:
- Add (if not added before) the exportOptionsPlist argument to your xcodebuild command:
-exportOptionsPlist <path/to/ExportOptions>.plist
Note: the xcodebuild command may be run by your CI/CD tool, so you may have to find the script where it runs from and update the command there, if needed.
- Set the manageAppVersionAndBuildNumber as false in your exportOptions.plist file as exemplified in the bellow snippet:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>manageAppVersionAndBuildNumber</key>
<false/>
</dict>
</plist>
If you don't have any exportOptions.plist yet, you can create one with just the above content.
You may now build your app once again, given that at this point, Xcode’s automatic version and build number is disabled.
Should you have any questions, do not hesitate to contact our support team at support@futurae.com or at support.futurae.com.
Comments
0 comments
Please sign in to leave a comment.