Learn how to make the most out of the Dropbox Community 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);
}];
- Greg-DB
Dropbox Staff
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.5,965 PostsLatest Activity: 6 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!