Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
sipius
6 years agoExplorer | Level 3
Error Uploading File :-1: linker command failed with exit code 1 (use -v to see invocation)
I created a Pdf file which prints and emails without any problems and im trying to upload to my dropbox apps folder. This is my first dropbox App and I need help please.
I keep getting this error : -1: linker command failed with exit code 1 (use -v to see invocation)
My Code is as follows:
Appdelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
//Begin Dropbox
[DBClientsManager setupWithAppKey:@"<APP_KEY_REDACTED>"];
DBUserClient *client = [[DBUserClient alloc] initWithAccessToken:@"<ACCESS_TOKEN_REDACTED>"];
return YES;
}
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
DBOAuthResult *authResult = [DBClientsManager handleRedirectURL:url];
if (authResult != nil) {
if ([authResult isSuccess]) {
NSLog(@"Success! User is logged into dropbox.");
} else if ([authResult isCancel]) {
NSLog(@"Authorization flow was manually canceled by user!");
} else if ([authResult isError]) {
NSLog(@"Error: %@", authResult);
}
}
return NO;
}
Viewcontroller.m
DBUserClient *client = [DBClientsManager authorizedClient ];
NSData *fileData = [@"yourPDF.pdf" dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:NO];
DBFILESWriteMode *mode = [[DBFILESWriteMode alloc] initWithOverwrite];
[[[client.filesRoutes uploadData:@"/test/path/in/Dropbox/account/yourPDF.pdf"
mode:mode
autorename:@(YES)
clientModified:nil
mute:@(NO)
propertyGroups:nil
strictConflict:nil
inputData:fileData]
setResponseBlock:^(DBFILESFileMetadata *result, DBFILESUploadError *routeError, DBRequestError *networkError) {
if (result) {
NSLog(@"%@\n", result);
} else {
NSLog(@"%@\n%@\n", routeError, networkError);
}
}] setProgressBlock:^(int64_t bytesUploaded, int64_t totalBytesUploaded, int64_t totalBytesExpectedUploaded) {
NSLog(@"\n%lld\n%lld\n%lld\n", bytesUploaded, totalBytesUploaded, totalBytesExpectedUploaded);
}];
1 Reply
Replies have been turned off for this discussion
- Greg-DB6 years ago
Dropbox Community Moderator
This appears to be a duplicate of your latest question in your earlier thread. I've already replied there, so I'm closing this one in favor of the earlier thread.
About 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!