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

Ios-deploy install fails #308

Closed
6 tasks
RobertArissen opened this issue Aug 11, 2017 · 23 comments
Closed
6 tasks

Ios-deploy install fails #308

RobertArissen opened this issue Aug 11, 2017 · 23 comments
Labels
Milestone

Comments

@RobertArissen
Copy link

RobertArissen commented Aug 11, 2017

Hello,

Expected behavior

Install ios-deploy global via NPM

Actual behavior.

Ios-deploy not installed and get the error:

Ld build/Release/ios-deploy normal x86_64
cd /usr/local/lib/node_modules/ios-deploy
export MACOSX_DEPLOYMENT_TARGET=10.8
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -L/usr/local/lib/node_modules/ios-deploy/build/Release -F/usr/local/lib/node_modules/ios-deploy/build/Release -filelist /usr/local/lib/node_modules/ios-deploy/build/ios-deploy.build/Release/ios-deploy.build/Objects-normal/x86_64/ios-deploy.LinkFileList -mmacosx-version-min=10.8 -Xlinker -object_path_lto -Xlinker /usr/local/lib/node_modules/ios-deploy/build/ios-deploy.build/Release/ios-deploy.build/Objects-normal/x86_64/ios-deploy_lto.o -fobjc-arc -fobjc-link-runtime -framework MobileDevice -F/System/Library/PrivateFrameworks -framework Foundation -framework CoreFoundation -Xlinker -dependency_info -Xlinker /usr/local/lib/node_modules/ios-deploy/build/ios-deploy.build/Release/ios-deploy.build/Objects-normal/x86_64/ios-deploy_dependency_info.dat -o /usr/local/lib/node_modules/ios-deploy/build/Release/ios-deploy
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 build/Release/ios-deploy normal x86_64
(1 failure)
npm ERR! code ELIFECYCLE
npm ERR! errno 65
npm ERR! [email protected] preinstall: ./src/scripts/check_reqs.js && xcodebuild
npm ERR! Exit status 65
npm ERR!
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Steps to reproduce the problem

I only run the command: npm install -g ios-deploy

System Specs

  • 1. system_profiler SPSoftwareDataType
    System Software Overview:
    System Version: macOS 10.12.6 (16G29)
    Kernel Version: Darwin 16.7.0
    Boot Volume: Macintosh HD
    Boot Mode: Normal
    Secure Virtual Memory: Enabled
    System Integrity Protection: Enabled
    Time since boot: 2:52

  • 2. ios-deploy -V

  • 3. xcodebuild -version
    Xcode 9.0
    Build version 9M202q

  • 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=/usr/include/c++/4.2.1
    Apple LLVM version 9.0.0 (clang-900.0.34.1)
    Target: x86_64-apple-darwin16.7.0
    Thread model: posix
    InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

  • 6. lldb --version
    lldb-900.0.41
    Swift-4.0

@shazron
Copy link

shazron commented Aug 11, 2017

Hello, when you filed a new issue, you deleted the template of requirements needed for filing a bug report. Please do that, there is not enough information. Without it, this issue will be closed.

@RobertArissen
Copy link
Author

Updated

@shazron
Copy link

shazron commented Aug 11, 2017

This is the root of the problem:
ld: framework not found MobileDevice and you are using Xcode 9. It may be missing in Xcode 9. I will investigate later.

@shazron shazron changed the title Ios-depoly install fails Ios-deploy install fails Aug 11, 2017
@shazron shazron added the bug label Aug 11, 2017
@shazron shazron added this to the 1.9.2 milestone Aug 11, 2017
@DomT4
Copy link

DomT4 commented Aug 15, 2017

It seems to have vanished from Xcode 9, but curiously is in the Command-Line Tools package Apple also distributes and after installing that it becomes available at the usual:

/System/Library/PrivateFrameworks/MobileDevice.framework/MobileDevice

Build still fails though.

@shazron
Copy link

shazron commented Aug 15, 2017

It's probably looking for it at:
$XCODE/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/PrivateFrameworks/MobileDevice.framework/

where $XCODE is:
xcode-select -p

@shazron
Copy link

shazron commented Aug 15, 2017

@DomT4
Copy link

DomT4 commented Aug 15, 2017

where $XCODE is: xcode-select -p

Yeah, this is enforced. If you flip it back to the CLT using sudo xcode-select --reset the build aborts & tells you your active developer path needs to be an Xcode instance.

This smells like an Xcode bug to me, I can't imagine why this behaviour would be intentional. If you create any small valid test.c file & then do:

~> clang -Wall -framework MobileDevice -F/System/Library/PrivateFrameworks test.c

It fails with the now rather familiar:

 "/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -no_deduplicate -dynamic -arch x86_64 -macosx_version_min 10.13.0 -syslibroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -o a.out -framework MobileDevice /var/folders/qs/rg1v7kz56wv3v9z4qwgtv3g80000gn/T/test-cfda58.o -L/usr/local/lib -lSystem /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a -F/System/Library/PrivateFrameworks
ld: framework not found MobileDevice
clang: error: linker command failed with exit code 1 (use -v to see invocation)

But if you explicitly use the clang inside the CLT it works fine:

~> /Library/Developer/CommandLineTools/usr/bin/clang -Wall -framework MobileDevice -F/System/Library/PrivateFrameworks test.c

~> file a.out
a.out: Mach-O 64-bit executable x86_64

~> otool -L a.out
a.out:
	/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.0.0)

~> ./a.out
testSUCCESS

@shazron
Copy link

shazron commented Aug 24, 2017

Similar report in #311

@DomT4
Copy link

DomT4 commented Aug 24, 2017

Apple is aware of the issue. Last update was 3 days ago, an acknowledgement that they are looking into it with the information provided.

@DomT4
Copy link

DomT4 commented Aug 25, 2017

Apparently if some PrivateFramework linking remains broken through to GM we're stuck with it.

Apple took 10+ days to decide they had no interest in fixing the bug. So ios-deploy might continue to have issues with Xcode 9+ unless the Xcode clang is accidentally fixed or a workaround is found here.

screen shot 2017-08-25 at 18 55 05

I can link to other private frameworks just fine, so, I'm hoping they accidentally fix linking this specific one.

@antonioribeiro
Copy link

Trying to fix

image

For which updating header paths was not helping, I decided to install ios-deploy and now I'm getting the very same error and cordova build also gives me a

Error: ios-deploy was not found. Please download, build and install version 1.9.0 or greater from https://github.com/phonegap/ios-deploy into your path, or do 'npm install -g ios-deploy'

Thank you, Apple.

@DomT4
Copy link

DomT4 commented Sep 15, 2017

Intentionally or not, this is apparently fixed in the Xcode GM. clang -Wall -framework MobileDevice -F/System/Library/PrivateFrameworks test.c now delivers success & the expected linkage.

@shazron
Copy link

shazron commented Sep 15, 2017

That's great. We'll wait and see if it's permanent, the workaround should still work for now

@tommybananas
Copy link

@shazron what is the workaround?

@shazron
Copy link

shazron commented Oct 30, 2017

@tommybananas see #314

@bjanuario
Copy link

If you are under Sierra you need to add the flag --unsafe-perm=true
sudo npm install -g ios-deploy --unsafe-perm=true

@tresdev
Copy link

tresdev commented Jan 22, 2018

@bjanuario this fixed the issue for me

@pyqui
Copy link

pyqui commented Mar 25, 2018

@bjanuario Oh yeah!!! It works!

@himalayaahuja
Copy link

@bjanuario It installs the package successfully yes, but again when I create a cordova ios build it throws the same error , saying ---------------
Unhandled promise rejection (rejection id: 1): ios-deploy was not found. Please download, build and install version 1.9.2 or greater from https://github.com/phonegap/ios-deploy into your path, or do 'npm install -g ios-deploy'

@pabloca88
Copy link

@bjanuario solved my issue.. great Job!

@mshyrokiy
Copy link

"sudo npm install -g ios-deploy --unsafe-perm=true" doesn't work for me
macOS 10.13.6
xcode Version 10.0 beta 3 (10L201y)

Is there any other way to get "ios-deploy" installed?

@sgalvagno
Copy link

sgalvagno commented Dec 27, 2018

@mshyrokiy
brew install ios-deploy

@ziwei3749
Copy link

ziwei3749 commented Jul 24, 2019

@sgalvagno this way make it work,thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests