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: 

Error Uploading File :-1: linker command failed with exit code 1 (use -v to see invocation)

Error Uploading File :-1: linker command failed with exit code 1 (use -v to see invocation)

sipius
Explorer | Level 3

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 1

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.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?