Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm install of ios-deploy fails with "ld: framework not found MobileDevice" on macOS Catalina #415

Closed
5 of 6 tasks
michelleangela opened this issue Oct 21, 2019 · 36 comments

Comments

@michelleangela
Copy link

Expected behavior

can install ios-deploy with npm

Actual behavior

install ios-deploy fails with error

ld: framework not found MobileDevice
clang: error: linker command failed with exit code 1 (use -v to see invocation)

see attached logs for details
2019-10-21T21_18_50_387Z-debug.log

Steps to reproduce the problem

Install iso-deploy using npm

sudo npm install -g -unsafe-perm=true ios-deploy

System Specs

Please run the commands below in your Terminal.app and include it in the issue. Check when done and include results below.

  • 1. system_profiler SPSoftwareDataType
    Software:

    System Software Overview:

    System Version: macOS 10.15 (19A603)
    Kernel Version: Darwin 19.0.0
    Boot Volume: Macintosh HD
    Boot Mode: Normal
    Computer Name: macminimdd
    User Name: mdd (mdd)
    Secure Virtual Memory: Enabled
    System Integrity Protection: Enabled
    Time since boot: 2:07
    
  • 2. ios-deploy -V
    n/a. cannot install ios-deploy

  • 3. xcodebuild -version
    Xcode 11.1
    Build version 11A1027

  • 4. xcode-select --print-path
    /Applications/Xcode.app/Contents/Developer

  • 5. gcc --version
    Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
    Apple clang version 11.0.0 (clang-1100.0.33.8)
    Target: x86_64-apple-darwin19.0.0
    Thread model: posix
    InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

  • 6. lldb --version
    lldb-1100.0.28.19
    Apple Swift version 5.1 (swiftlang-1100.0.270.13 clang-1100.0.33.7)

@michelleangela
Copy link
Author

I tried workarounds posted here #387 (comment) and it didn't work.

@Kennytian
Copy link

1. system_profiler SPSoftwareDataType
Software:
    System Software Overview:

      System Version: macOS 10.15 (19A602)
      Kernel Version: Darwin 19.0.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: Kenny’s Mac
      User Name: Kenny (kenny)
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: 1 day 1:31

2. ios-deploy -V
n/a. cannot install ios-deploy

 3. xcodebuild -version
Xcode 11.1
Build version 11A1027

4. xcode-select --print-path
/Applications/Xcode.app/Contents/Developer

5. gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.0 (clang-1100.0.33.8)
Target: x86_64-apple-darwin19.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

6. lldb --version
lldb-1100.0.28.19
Apple Swift version 5.1 (swiftlang-1100.0.270.13 clang-1100.0.33.7)

The same issue here.

@Kennytian
Copy link

@michelleangela

You can try following steps:

  1. npm uninstall -g ios-deploy

  2. yarn global remove ios-deploy (if you installed it with yarn global)

  3. npm i -g ios-deploy@beta

It's work to me.

@michelleangela
Copy link
Author

michelleangela commented Oct 22, 2019

  1. npm uninstall -g ios-deploy
  2. yarn global remove ios-deploy (if you installed it with yarn global)
  3. npm i -g ios-deploy@beta

The version ios-deploy@beta fails to install as well.

@matamune94
Copy link

** BUILD FAILED **


The following build commands failed:
	Ld /usr/local/lib/node_modules/ios-deploy/build/Release/ios-deploy normal x86_64
(1 failure)

not working help

@lvlkoo
Copy link

lvlkoo commented Oct 24, 2019

Same for me. Any solution for this?
MacOS 10.15 Catalina

@michaelpeterlee
Copy link

If anyone is here from the Ionic v1 project, you can ignore this error when building iOS; Just open the project in XCode.

@michelleangela
Copy link
Author

Other npm packages that take a dependency on the ios-deploy will also fail to install because ios-deploy fails to install. In particular we'd like to get the ios-deploy installation fixed to successfully install the vcremote package.

@maximovalexei
Copy link

** BUILD FAILED **


The following build commands failed:
	Ld /usr/local/lib/node_modules/ios-deploy/build/Release/ios-deploy normal x86_64
(1 failure)

не работает помощь

Аналогичная проблема

@N-Olbert
Copy link

N-Olbert commented Oct 28, 2019

Other npm packages that take a dependency on the ios-deploy will also fail to install because ios-deploy fails to install. In particular we'd like to get the ios-deploy installation fixed to successfully install the vcremote package.

@michelleangela Installing ios-deploy via brew works for me on Catalina 10.15 (brew uses a precompiled tarball). As vcremote requires/installs brew anyways could it be a workaround to modify the vcremote package to use brew (instead of npm) to install ios-deploy?

@abowerman
Copy link

Other npm packages that take a dependency on the ios-deploy will also fail to install because ios-deploy fails to install. In particular we'd like to get the ios-deploy installation fixed to successfully install the vcremote package.

@michelleangela Installing ios-deploy via brew works for me on Catalina 10.15 (brew uses a precompiled tarball). As vcremote requires/installs brew anyways could it be a workaround to modify the vcremote package to use brew (instead of npm) to install ios-deploy?

for the people skimming:

brew install ios-deploy

Should do the trick.

@penicsn
Copy link

penicsn commented Oct 29, 2019

I solved this way:

  • git clone https://github.com/ios-control/ios-deploy.git --branch=1.9.4
  • cd to ios-deploy then: npm i
  • xcodebuild
  • sudo cp -R /[IOS-DEPLOY-DIR] /usr/local/lib/node_modules
  • ln -s /usr/local/lib/node_modules/ios-deploy/build/Release/ios-deploy /usr/local/bin/

@HristoSmerikarov
Copy link

Had the same issue, but resolved it with a "two-step-before" fix:
flutter/flutter#22595

@clnorris
Copy link

Do any of the suggested fixes allow vcremote to be installed? Can vcremote installation be changed to use one of the workarounds?

@Edison4mobile
Copy link

@penicsn
It is not working in mac os catalina 10.15 Beta

@LeoHYS
Copy link

LeoHYS commented Oct 31, 2019

the same issue, and try all the solutions above, still not working.

@itlijunjie
Copy link

#387 (comment)

@pryorm92
Copy link

pryorm92 commented Nov 2, 2019

#387 (comment)

Thanks, but that had already been tried by many of us without success.

@mesqueeb
Copy link

mesqueeb commented Nov 4, 2019

I was able to fix this issue by doing what was described here:

rm -fr ~/Library/Developer/Xcode/DerivedData/ios-deploy-*
npm -g uninstall ios-deploy
npm -g install ios-deploy@beta

And it worked.

@ElieMyIdea
Copy link

3. npm i -g ios-deploy@beta

Other npm packages that take a dependency on the ios-deploy will also fail to install because ios-deploy fails to install. In particular we'd like to get the ios-deploy installation fixed to successfully install the vcremote package.

@michelleangela Installing ios-deploy via brew works for me on Catalina 10.15 (brew uses a precompiled tarball). As vcremote requires/installs brew anyways could it be a workaround to modify the vcremote package to use brew (instead of npm) to install ios-deploy?

for the people skimming:

brew install ios-deploy

Should do the trick.

After correctly cleaning is working well

@lingzt
Copy link

lingzt commented Nov 7, 2019

@michelleangela

You can try following steps:

  1. npm uninstall -g ios-deploy
  2. yarn global remove ios-deploy (if you installed it with yarn global)
  3. npm i -g ios-deploy@beta

It's work to me.

Thanks for the tips. Before all the steps I cleaned my Derivedata, and it works!

@gabebear
Copy link

I believe this is linked to the version of Xcode used. Here is what testing on my Mojave(10.14.6) Mac shows:

  • Xcode 10.2.1 - success
  • Xcode 10.3 - success
  • Xcode 11.0 - ld: framework not found MobileDevice
  • Xcode 11.1 - ld: framework not found MobileDevice
  • Xcode 11.2 - ld: framework not found MobileDevice

@meesha81
Copy link

#install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

#install ios-deploy, working for Catalina 10.15.1
brew install ios-deploy

@zakabluk
Copy link

zakabluk commented Dec 2, 2019

I believe this is linked to the version of Xcode used. Here is what testing on my Mojave(10.14.6) Mac shows:

  • Xcode 10.2.1 - success
  • Xcode 10.3 - success
  • Xcode 11.0 - ld: framework not found MobileDevice
  • Xcode 11.1 - ld: framework not found MobileDevice
  • Xcode 11.2 - ld: framework not found MobileDevice

@mesqueeb comment helped me at similar situation.

@gabebear
Copy link

gabebear commented Dec 9, 2019

With 1.10.0 released I think this is now resolved.

@gabebear gabebear closed this as completed Dec 9, 2019
@michelleangela
Copy link
Author

With 1.10.0 released I think this is now resolved.

I tried installing 1.10.0 and still got the error (full log attached):

ld: framework not found MobileDevice
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **


The following build commands failed:
	Ld /usr/local/lib/node_modules/ios-deploy/build/Release/ios-deploy normal x86_64
(1 failure)

Used Xcode 11.2.1

2019-12-09T22_05_40_717Z-debug.log

Is there something I'm missing? A pre-requisite, etc?

@gabebear gabebear reopened this Dec 9, 2019
@gabebear
Copy link

gabebear commented Dec 10, 2019

@michelleangela Was this on Catalina?

I’m not sure what’s up, but can look at it tomorrow.

To help narrow things down, what is your?

  • OS version:
  • Xcode version:
  • npm version:
  • node version:
  • bash or zsh:

(Catalina user accounts upgraded from Mojave use bash, but newly created accounts use zsh)

@michelleangela
Copy link
Author

The error was on Catalina, which was upgraded from Mojava.

OS:

System Software Overview:

  System Version: macOS 10.15.1 (19B88)
  Kernel Version: Darwin 19.0.0
  Boot Volume: Macintosh HD
  Boot Mode: Normal
  Computer Name: macminimdd
  User Name: mdd (mdd)
  Secure Virtual Memory: Enabled
  System Integrity Protection: Enabled
  Time since boot: 17 days 4:39

xcodebuild -version
Xcode 11.2.1
Build version 11B500

npm -version
6.12.0 (I also tried with 6.13.2 and failed)

node -v
v12.13.0

Used bash, upgraded from Mojave
echo $BASH_VERSION
3.2.57(1)-release

gabebear added a commit that referenced this issue Dec 10, 2019
We aren't abandoning node/npm yet... but with the odd issues in #415 it's prudent to not direct people toward node when we aren't really using it.
@gabebear
Copy link

gabebear commented Dec 10, 2019

@michelleangela Does installing via brew work for you? (e.g. the changes in #429)

If you have previously installed ios-deploy via npm, uninstall it by running:

sudo npm uninstall -g ios-deploy

Install ios-deploy via Homebrew by running:

brew install ios-deploy

I'm going to update a computer to Catalina today to look at this further.

@gabebear
Copy link

@michelleangela I setup a system extremely close to yours and I'm not seeing a failure.

  • macOS 10.15.1 with account updated from Mojave
  • xcodebuild -version : Xcode 11.2.1 Build version 11B500
  • npm -version : 6.12.1
  • node -v : v12.13.1
  • echo $BASH_VERSION : 3.2.57(1)-release

My npm and node versions were .1 higher than the versions than you have(I let brew install the node@12 package to get those versions). Can you please try updating to see if the NodeJS maintaners fixed something for Catalina in that release.

The pre-install script that fails is running ./src/scripts/check_reqs.js && xcodebuild. Can you try running those by themselves and see if either ./src/scripts/check_reqs.js fails with something interesting or if xcodebuild is what is failing?

@michelleangela
Copy link
Author

@gabebear

Quick update:

  • Installing ios-deploy via brew works.
  • I updated node to 13.3.0 via brew and used npm 6.13.2, and sudo npm install -g -unsafe-perm=true ios-deploy still fails. I also tried clearing the cache of npm.
  • The script ./src/scripts/check_reqs.js && xcodebuild builds successfully from local folder of git cloning of ios-deploy.
  • I tried uninstalling node and npm and then re-installing node.js via downloaded package from https://nodejs.org/ and ios-deploy still fails.

There may be something else configured differently on my machine that's causing the installation to fail.

@gabebear
Copy link

@michelleangela could you try one more thing?

In a clone of the repo can open package.json and change this line:

  • "preinstall": "./src/scripts/check_reqs.js && xcodebuild",

to this:

  • "preinstall": "xcodebuild",

and try running:

npm install

(also try it with the line unmodified)

The check_reqs.js 'should' only check that you have Xcode installed and fail with a nice message(but it might be failing for some strange reason).

gabebear added a commit that referenced this issue Dec 10, 2019
Remove node/npm from README installation steps (in favor of brew)

Verified that this fixes the issue we saw in  #415 ... but still not sure why npm is failing.
@michelleangela
Copy link
Author

michelleangela commented Dec 10, 2019

@gabebear

npm install works for both cases of preinstall commands.

One thing I tried was comparing the outputs of building the package under the folder that npm would install ios-deploy with output of installing from npm. When installing via npm, I would use sudo and noticed that this would reference a different path for USER_APPS_DIR and USER_LIBRARY_DIR, etc.

Using sudo

   export USER_APPS_DIR=/var/root/Applications
   export USER_LIBRARY_DIR=/var/root/Library

No sudo

   export USER_APPS_DIR=/Users/mdd/Applications
   export USER_LIBRARY_DIR=/Users/mdd/Library

Building locally with sudo, produces error:

npm WARN lifecycle ios-deploy@1.10.0~preinstall: cannot run in wd ios-deploy@1.10.0 ./src/scripts/check_reqs.js && xcodebuild (wd=/usr/local/lib/node_modules/ios-deploy2)
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path /usr/local/lib/node_modules/ios-deploy2/build/Release/ios-deploy
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/local/lib/node_modules/ios-deploy2/build/Release/ios-deploy'
npm ERR! enoent This is related to npm not being able to find a file.

Then, I tried installing via npm but without sudo this time and installation was successful.

It looks like the issue was different paths were getting references under different user permissions. Perhaps I had installed some things using sudo and some without sudo.

Thank you for helping to investigate! I think the problem is resolved.

@gabebear
Copy link

Odd... but glad it's working for you. Hopefully brew installs won't have these weird edge cases.

@Apuyuseng
Copy link

$ brew install ios-deploy
Updating Homebrew...
==> Downloading https://homebrew.bintray.com/bottles/ios-deploy-1.10.0.catalina.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring ios-deploy-1.10.0.catalina.bottle.1.tar.gz
🍺 /usr/local/Cellar/ios-deploy/1.10.0: 5 files, 232.2KB

@soorajshankar
Copy link

Try this

sudo npm i -g ios-deploy@beta --unsafe-perm=true

geekonion pushed a commit to geekonion/ios-deploy that referenced this issue Jun 29, 2023
We aren't abandoning node/npm yet... but with the odd issues in ios-control#415 it's prudent to not direct people toward node when we aren't really using it.
geekonion pushed a commit to geekonion/ios-deploy that referenced this issue Jun 29, 2023
Remove node/npm from README installation steps (in favor of brew)

Verified that this fixes the issue we saw in  ios-control#415 ... but still not sure why npm is failing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests