Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

Robert S.138's avatar
Robert S.138
Helpful | Level 7
6 years ago
Solved

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.

     

10 Replies

Replies have been turned off for this discussion
  • Robert S.138's avatar
    Robert S.138
    Helpful | Level 7
    6 years ago

    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-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    6 years ago

    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! 

  • Robert S.138's avatar
    Robert S.138
    Helpful | Level 7
    6 years ago

    Here is the latest minimal failure example:

     

    Start XCODE 12.0.1:  Select "New Project".  Select "App".  Project Name: "TuneLab3"  Create.

    This skeleton program builds OK.  Now to manually add Dropbox as a subproject (which also involves Carthage).

    Create Cartfile in project root with the following contents:

     

    # ObjectiveDropboxOfficial

    github "https://github.com/dropbox/dropbox-sdk-obj-c" ~> 5.0.3

     

    Open a terminal window, navigate to the project root, and do:

     

    carthage update --platform iOS

     

    And this is the output:

     

    *** Fetching dropbox-sdk-obj-c

    *** Checking out dropbox-sdk-obj-c at "5.0.3"

    *** xcodebuild output can be found in /var/folders/mh/0wpmn3f15r18xmqnrgtyzrgm0000gn/T/carthage-xcodebuild.YEPV7A.log

    *** Building scheme "ObjectiveDropboxOfficial iOS" in ObjectiveDropboxOfficial.xcodeproj

    Build Failed

    Task failed with exit code 1:

    /usr/bin/xcrun lipo -create /Users/robertscott/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0.1_12A7300/dropbox-sdk-obj-c/5.0.3/Build/Intermediates.noindex/ArchiveIntermediates/ObjectiveDropboxOfficial\ iOS/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/ObjectiveDropboxOfficial.framework/ObjectiveDropboxOfficial /Users/robertscott/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0.1_12A7300/dropbox-sdk-obj-c/5.0.3/Build/Products/Release-iphonesimulator/ObjectiveDropboxOfficial.framework/ObjectiveDropboxOfficial -output /Users/robertscott/Documents/iOSdev/TuneLab3/Carthage/Build/iOS/ObjectiveDropboxOfficial.framework/ObjectiveDropboxOfficial

     

    This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/mh/0wpmn3f15r18xmqnrgtyzrgm0000gn/T/carthage-xcodebuild.YEPV7A.log

     

     

    But when I look at the log file cited, it is an 8 MB file that ends with:

    ** BUILD SUCCEEDED **

     

    Should I just trust that everything is OK?

     

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    6 years ago

    Thanks for following up. It looks like this is due to that Carthage issue. We can't officially offer support for Carthage itself as that's not made by Dropbox though, so I'll have to defer to the information in the Carthage issue regarding this. It looks like that's currently still open.

     

    For reference though, one way to check the version of the Dropbox Objective-SDK that is loaded in a project is to check the value of `kDBSDKVersion` in code, which is a constant containing the Dropbox Objective-SDK version number.

  • Robert S.138's avatar
    Robert S.138
    Helpful | Level 7
    6 years ago

    Is there a way to add the Dropbox SDK to an XCODE project that does not involve any 3rd party software like Carthage or CocoaPods just by copying source code directly?  Even though the problem I need to debug in iOS 14 has nothing to do with Dropbox, if I can't even build my app for iOS 14 I can't do any debugging on that issue and I can't build for iOS 14 without XCODE 12.

     

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    6 years ago

    No, unfortunately the only officially supported installation methods for the Dropbox API v2 Objective-C SDK use Cocoapods or Carthage, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though. 

  • Robert S.138's avatar
    Robert S.138
    Helpful | Level 7
    6 years ago

    In the meantime perhaps someone at Dropbox could at least try to add the SDK to a new skeleton project using XCODE 12.  The test is to build for both the simulator and a real ARM device.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    6 years ago

    I'll pass this request along (though we'd also run in to the same issues with Cocoapods/Carthage anyway).

     

    It looks like there are some workarounds available in the Carthage issue while they work to resolve this properly, so you may want to use one of those to get running for now. (Or, likewise use Cocoapods 1.10, which seems to currently be in beta, per the Cocoapods issue.)

  • Robert S.138's avatar
    Robert S.138
    Helpful | Level 7
    6 years ago

    **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

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If 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, Facebook or Instagram.

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!