We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
Robert S.138
5 years agoHelpful | Level 7
Can't build for iOS Simulator when SDK installed with Carthage
Apple broke my Dropbox SDK installation in their latest XCODE 12.0.1. I was using the Cocoa Pods method ever since Dropbox V2 came out. So I decided to redo my project using Carthage. It works fine when building for an iOS device, but fails when building for the simulator. I don't know how Cocoa Pods handled it. All I know it that it used to work. But with Carthage, apparently, the SDK builds a static library for ARM processors only, and the simulator requires X86_64. By the way, the failure in the Cocoa Pods method was that the Dropbox SDK headers were not found when building for the simulator, even though they were found when building for devices. So with both Carthage and with Cocoa Pods, I can build for devices but not for the simulator, but for different reasons. Is there a way with XCODE 12.0.1 to build for the simulator? (I need to use the latest XCODE because I am debugging an iOS 14 problem which is only supported in XCODE 12.)
**SOLVED**
The main problem was that the Intel 64-bit architecture was not recognized by XCODE as on of the build architectures. That in turn was caused by the update to XCODE 12. Even though the architectures were properly indicated as $(ARCHS_STANDARD) in both the project and the target build settings, they were being overriden by a setting in the USER-DEFINED section of the build settings that XCODE transferred there for some reason. The setting in USER-DEFINED was
VALID_ARCHS armv7 arm64
The solution was to click on this setting and hit DELETE so it totally vanishes. Then the main project build settings that include all standard architectures can be effective. It was odd that this error led to the error "ObjectiveDropboxOfficial/ObjectiveDropboxOfficial.h" not found. But perhaps it had to do with CocoaPods making a copy of the header files for each architecture, because this error did not happen when building for a real device. Anyway, it is solved.
Oh, I gave up on Carthage and returned to my original Cocoapods setup. Also I updated Cocoapods to the latest, version 1.10.0 with
sudo gem install cocoapods
Also I updated the ObjectiveDropboxOfficial project to ver 5.0.3 with:
pod update
pod deintegrate
pod install
(I don't know if the last two commands were necessary.)
Updating to Dropbox API version 5.0.3 and XCODE 12 only required two small accomodations in my source code. One was that the type of the first parameter in the response block for the function createFolderV2 had to be changed from DBFILESFolderMetadata to DBFILESCreateFolderResult. The other change was that [DBClientsManager handleRedirectURL] now uses a completion block instead of returning the DBOAuthResult directly.
Anyway, I am back to using Cocoapods and everything is working as it should.
- Robert S.138Helpful | Level 7
In addition to the problems with the Dropbox API installed with Carthage, I even tried making a new project with Cocoa Pods. In both cases, the XCODE 12 build process crashes whenever one of my application source files imports "ObjectiveDropboxOfficial.h". Has anyone successfully used XCODE 12 to build a project for the simulator containing the Dropbox API?
- Greg-DBDropbox Staff
Thanks for the report! We'll look into this to see what the issue may be.
To make sure we reproduce the same problem you're seeing though, can you share the relevant error messages you're getting? Thanks in advance!
- Greg-DBDropbox Staff
It looks like these issues are due to incompatibilies with Xcode 12 in both Cocoapods and Carthage.
For Cocoapods, please refer to this issue: https://github.com/CocoaPods/CocoaPods/issues/9902
For Carthage, please refer to this issue: https://github.com/Carthage/Carthage/issues/3019
- Robert S.138Helpful | Level 7
**SOLVED**
The main problem was that the Intel 64-bit architecture was not recognized by XCODE as on of the build architectures. That in turn was caused by the update to XCODE 12. Even though the architectures were properly indicated as $(ARCHS_STANDARD) in both the project and the target build settings, they were being overriden by a setting in the USER-DEFINED section of the build settings that XCODE transferred there for some reason. The setting in USER-DEFINED was
VALID_ARCHS armv7 arm64
The solution was to click on this setting and hit DELETE so it totally vanishes. Then the main project build settings that include all standard architectures can be effective. It was odd that this error led to the error "ObjectiveDropboxOfficial/ObjectiveDropboxOfficial.h" not found. But perhaps it had to do with CocoaPods making a copy of the header files for each architecture, because this error did not happen when building for a real device. Anyway, it is solved.
Oh, I gave up on Carthage and returned to my original Cocoapods setup. Also I updated Cocoapods to the latest, version 1.10.0 with
sudo gem install cocoapods
Also I updated the ObjectiveDropboxOfficial project to ver 5.0.3 with:
pod update
pod deintegrate
pod install
(I don't know if the last two commands were necessary.)
Updating to Dropbox API version 5.0.3 and XCODE 12 only required two small accomodations in my source code. One was that the type of the first parameter in the response block for the function createFolderV2 had to be changed from DBFILESFolderMetadata to DBFILESCreateFolderResult. The other change was that [DBClientsManager handleRedirectURL] now uses a completion block instead of returning the DBOAuthResult directly.
Anyway, I am back to using Cocoapods and everything is working as it should.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,877 PostsLatest Activity: 12 months agoIf you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!