cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problems when migrating from API v1 to v2

Problems when migrating from API v1 to v2

Mr_K
Explorer | Level 3
Go to solution

When migrating my Objective C project for iOS from Dropbox API v1 to v2

I am changing my source code, replacing old

 

#import <DropboxSDK/DropboxSDK.h>

to new

#import <ObjectiveDropboxOfficial/ObjectiveDropboxOfficial.h>

 

But when compiling the project I get an error:

 

'ObjectiveDropboxOfficial/ObjectiveDropboxOfficial.h' file not found

 

Also in "Pods > Products" section in Xcode both "ObjectiveDropboxOfficial.framework" and "Pods_BASIC.framework" frameworks are marked in red color.

 

 

What settings are missing or what I am doing wrong?

 

1 Accepted Solution

Accepted Solutions

Stephen C.14
Dropbox Staff
Go to solution

Then I would recommend using Carthage, rather than CocoaPods, as it is less invasive. You can build the binaries with Carthage and then drage and drop them into each of your targets.

 

This approach will work better, I think.

View solution in original post

26 Replies 26

Greg-DB
Dropbox Staff
Go to solution

First, to confirm, it sounds like you're using the CocoaPods installation method, is that correct?

 

If so, can you share:

- your Podfile

- the version of CocoaPods you're using

- the version of Xcode you're using

 

Also, make sure you opened the .xcworkspace file and not the .xcodeproj file.

Mr_K
Explorer | Level 3
Go to solution

Yes, I am following your instructions to install Dropbox SDK using CocoaPods.

 

My Podfile:

 

# Uncomment the next line to define a global platform for your project
platform :ios, '8.0'

target 'BASIC' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
use_frameworks!

# Pods for BASIC
pod 'ObjectiveDropboxOfficial'

end

#target 'SB' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!

# Pods for SB

#end

 

Here pod init command created target 'SB' because my project has two targets: main 'BASIC' app target and 'SB' static library target (SB library uses Dropbox commands, BASIC app uses SB library). But I commented this target out because otherwise I get pod install error if 'SB' static library is present as a target.

 

CocoaPods version is 1.2.1

 

Xcode version is 8.3.3

Greg-DB
Dropbox Staff
Go to solution
What output did you get from 'pod install' for this Podfile?

Note that the Objective-C SDK supports iOS 9+, but you seem to be targeting iOS 8:

https://github.com/dropbox/dropbox-sdk-obj-c#system-requirements

Mr_K
Explorer | Level 3
Go to solution

$ pod install

Analyzing dependencies

Downloading dependencies

Using ObjectiveDropboxOfficial (3.0.15)

Generating Pods project

Integrating client project

Sending stats

Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

 

The very first pod install gave some warnings about framework path and compiler flags settings, so I added $(inherited) where it was necessary according to suggestion. After that pod install warnings went away.

 

Thank you for your note, changed my app deployment target to iOS 9 and updated Podfile to platform iOS 9.0.

 

#import <ObjectiveDropboxOfficial/ObjectiveDropboxOfficial.h>

still gives 'file not found' error.

Greg-DB
Dropbox Staff
Go to solution
Thanks! It does look like that succeeded, and if this is still occurring when you're trying with iOS 9, we'll have to investigate further to see what the issue may be.

To help with that, would it be possible for you to supply a sample project, or stripped down version of your project that is exhibiting this issue? It sounds like there's something about the configuration of your project that may be relevant here.

If you're prefer to share privately, you can open an API ticket with it here:

https://www.dropbox.com/developers/contact

Mr_K
Explorer | Level 3
Go to solution

Yes, thank you for your time.

 

Here is the stripped down project which has only one compilation error we are speaking about: https://yadi.sk/d/UB0trH753Jz7tr

Greg-DB
Dropbox Staff
Go to solution
Thanks! We'll look into it.

Stephen C.14
Dropbox Staff
Go to solution

Sorry for the delay here. Not sure why CocoaPods isn't working. Try adding `Pods_BASIC.framework` to `Link Binary With Libraries` under `Build Phases` for `SB` target (see attached image).

 

Let me know if this works for you.

 

Untitled.png

Mr_K
Explorer | Level 3
Go to solution

Thank you for your suggestion.

No, this did not help. Everything is the same.

 

I think that there could be some problems with SDK path, because an error like ".h file not found" is a compilation error, not linking error.

 

Also SDK files are marked with red color (image attached). This also can show some kind of problem with SDK location.

 

Снимок экрана 2017-06-13 в 3.59.27.png

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Mr_K Explorer | Level 3
  • User avatar
    Stephen C.14 Dropbox Staff
What do Dropbox user levels mean?