question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No known instance method for selector 'userAgent' in CDVFileTransfer.m

See original GitHub issue

Bug Report

Problem

When building using cordova-ios v6.0.0 an error is thrown saying:

“No known instance method for selector ‘userAgent’ in CDVFileTransfer.m”

What is expected to happen?

iOS build and run without error.

What does actually happen?

Error occurs as above

Information

The error occurs on line 107 of CDVFileTransfer.m":

NSString* userAgent = [self.commandDelegate userAgent];

Command or Code

Create a Cordova v9 project using cordova-ios 6.0.0 platform and version 1.7.1 of cordova-plugin-file-transfer run: cordova build ios

Environment, Platform, Device

Build error occurs using Cordova v9. cordova-ios 6.0.0 cordova-file-transfer-plugin v1.7.1

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:43
  • Comments:58 (4 by maintainers)

github_iconTop GitHub Comments

228reactions
jansccommented, Jun 5, 2020

By removing lines 107-110 from CDVFileTransfer.m I was able to compile:

    NSString* userAgent = [self.commandDelegate userAgent];
    if (userAgent) {
        [req setValue:userAgent forHTTPHeaderField:@"User-Agent"];
    }
17reactions
alssl-rosscommented, Jun 11, 2020

Given the plugin is deprecated, is it worth creating a pull request? I’m not sure if anyone is able to merge the pull request if it was created.

I’ve forked this repository and made this change in if it’s of use to anyone:

https://github.com/alssl-ross/cordova-plugin-file-transfer

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error in iOS Build with cordova-plugins - Appflow - Ionic Forum
I'm trying to build my app with the latest cordova-ios version 6.1.1 to ... /CDVFileTransfer.m:107:49: no known instance method for selector ...
Read more >
cordova-plugin-file-transfer is not working in ios build
Open the error file.
Read more >
[GitHub] [cordova-plugin-file-transfer] sandip7878 commented ...
... on issue #258: No known instance method for selector 'userAgent' in ... By removing lines 107-110 from CDVFileTransfer.m I was able to ......
Read more >
Issue with iOS build on meteor version 2.3.6 - help - Meteor forums
... version from 2.0 to 2.3.6, now i am getting below error while building iOS, No known instance method for selector 'userAgent' in...
Read more >
No known instance method for selector 'userAgent'
cordova-plugin-file-transfer has been updated to support cordova-ios 6, # but it has not been released yet, so you can only install it from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found