Learn how to make the most out of the Dropbox Community here 💙.
Forum Discussion
Mr_K
8 years agoExplorer | Level 3
Problems when migrating from API v1 to v2
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/O...
- 8 years ago
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.
Stephen C.14
Dropbox Staff
8 years agoSorry 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.
Mr_K
8 years agoExplorer | Level 3
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.
- Mr_K8 years agoExplorer | Level 3
Also I found this:
in BASIC project target in Build Phases there are two Run Script Phases:
[CP] Embed Pods Frameworks
[CP] Copy Pods Resources
and in SB project target these Build Phases are absent.
Maybe this can be the reason of error?
As far as I understand these Build Phases are created when installing pod, taking into account Podfile settings.
But in Podfile I have only one target: 'BASIC', target 'SB' is commented out, because if I also add 'SB' as a target:
platform :ios, '9.0'
target 'BASIC' do
use_frameworks!pod 'ObjectiveDropboxOfficial'
endtarget 'SB' do
use_frameworks!pod 'ObjectiveDropboxOfficial'
endI get these errors when installing pod:
$ pod install
Analyzing dependencies
[!] Unable to find host target(s) for SB. Please add the host targets for the embedded targets to the Podfile.
Certain kinds of targets require a host target. A host target is a "parent" target which embeds a "child" target. These are example types of targets that need a host target:
- Framework
- App Extension
- Watch OS 1 Extension
- Messages Extension (except when used with a Messages Application)
So, maybe this is the reason of error? But how to install pod for 'SB' target?
- Stephen C.148 years ago
Dropbox Staff
If you uncomment `target 'SB' do` in your Podfile, and then you run `pod install`, even with the CocoaPods errors, the .xcworkspace file builds for me for target `SB`.
Can you confirm this?
- Mr_K8 years agoExplorer | Level 3
This Podfile:
target 'BASIC' do
use_frameworks!
pod 'ObjectiveDropboxOfficial'
endtarget 'SB' do
endAnd this podfile:
target 'BASIC' do
use_frameworks!
pod 'ObjectiveDropboxOfficial'
endtarget 'SB' do
use_frameworks!
pod 'ObjectiveDropboxOfficial'
endBoth give the same pod install output:
Analyzing dependencies
[!] Unable to find host target(s) for SB. Please add the host targets for the embedded targets to the Podfile.
Certain kinds of targets require a host target. A host target is a "parent" target which embeds a "child" target. These are example types of targets that need a host target:
- Framework
- App Extension
- Watch OS 1 Extension
- Messages Extension (except when used with a Messages Application)And give these two Xcode compilation errors:
/Users/kibernetik/Мои программы/BASIC copy/SB/ViewController.h:7:9: 'ObjectiveDropboxOfficial/ObjectiveDropboxOfficial.h' file not found
Error: unable to read module map contents from 'Target Support Files/ObjectiveDropboxOfficial/ObjectiveDropboxOfficial.modulemap': Error Domain=NSCocoaErrorDomain Code=260 "The file “ObjectiveDropboxOfficial.modulemap” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/kibernetik/Мои программы/BASIC copy/Pods/Target Support Files/ObjectiveDropboxOfficial/ObjectiveDropboxOfficial.modulemap, NSUnderlyingError=0x7fd04bcfb3b0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
Of course Xcode was reloaded each time.
- Stephen C.148 years ago
Dropbox Staff
In your Podfile, please delete `use_frameworks!` for target `'SB'` only. Then things should work.
(it doesn't really make sense to link a framework to a library).
- Mr_K8 years agoExplorer | Level 3
I also have tried this variant. When my Podfile is:
platform :ios, '9.0'
target 'BASIC' do
use_frameworks!
pod 'ObjectiveDropboxOfficial'
end
target 'SB' do
pod 'ObjectiveDropboxOfficial'
endI get the same pod install warning and the same two errors.
Actually I get 'file no found' error even prior to compiling: Xcode editor immediately marks this code line as erroneous just after the project is loaded.
- Stephen C.148 years ago
Dropbox Staff
I still get the pod warnings as well, but everything builds correctly for me.
Please ensure that you close Xcode before calling `pod install` and that you open the `.xcworkspace` file and not the `.xcodeproj` file.
Please also do a full a rebuild (cmd+option+shift+k) after `pod install`.
If you have done all of these things, then please repost your updated project here, as I am not seeing the same issues that you are.
- Mr_K8 years agoExplorer | Level 3
All issues are the same.
This is the latest version of test project: https://yadi.sk/d/6W373tQ23K8Uyg
Thank you!
- Stephen C.148 years ago
Dropbox Staff
This project builds fine for me after running `pod install` and opening the `.xcworkspace` file.
Please ensure that you have Xcode Version 8.3.3+ installed.
- Mr_K8 years agoExplorer | Level 3
Can you please share back the project that compiles?
- Stephen C.148 years ago
Dropbox Staff
Same project as the one you just uploaded (the second one).
Which version of Xcode are you using? Please download the latest one, otherwise things might not compile.
- Mr_K8 years agoExplorer | Level 3
I am using Xcode 8.3.3 on macOS 10.12.5
- Stephen C.148 years ago
Dropbox Staff
Strange. So am I. When I run `pod install` on the project you uploaded, and open the `xcworkspace` file, and build, it builds successfully.
What's your output for `pod --version`?
Mine is:
```
scobbe-mbp:server scobbe$ pod --version
1.2.0.beta.1```
- Mr_K8 years agoExplorer | Level 3
My pod version is 1.2.1
It seems that
#import <ObjectiveDropboxOfficial/ObjectiveDropboxOfficial.h>
now raises no error, but when I compile that test project I get this error:
Error: unable to read module map contents from 'Target Support Files/ObjectiveDropboxOfficial/ObjectiveDropboxOfficial.modulemap': Error Domain=NSCocoaErrorDomain Code=260 "The file “ObjectiveDropboxOfficial.modulemap” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/kibernetik/Downloads/BASICcopy/Pods/Target Support Files/ObjectiveDropboxOfficial/ObjectiveDropboxOfficial.modulemap, NSUnderlyingError=0x7fa1f005d630 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
- Stephen C.148 years ago
Dropbox Staff
Can you try the steps here: https://stackoverflow.com/questions/30745675/cant-find-pods-modulemap-looking-in-wrong-directory
- Mr_K8 years agoExplorer | Level 3
No, this procedure and all other suggestions in that topic did not make missing file
/Pods/Target Support Files/ObjectiveDropboxOfficial/ObjectiveDropboxOfficial.modulemap
to appear. Making "pod install" command also does not create it.
Again I have "file not found" error concerning
#import <ObjectiveDropboxOfficial/ObjectiveDropboxOfficial.h>
- Stephen C.148 years ago
Dropbox Staff
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.
- Mr_K8 years agoExplorer | Level 3
Thank you for your suggestion!
I will try.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,965 PostsLatest Activity: 4 hours ago
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 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!