cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you an educator? Well we want to hear from you, so check out some tools we think might help you out 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

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

Greg-DB
Dropboxer

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.

Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?