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 SDK9.3 - PrivateFrameworks issues #146

Closed
merdok opened this issue Mar 22, 2016 · 31 comments
Closed

iOS SDK9.3 - PrivateFrameworks issues #146

merdok opened this issue Mar 22, 2016 · 31 comments

Comments

@merdok
Copy link

merdok commented Mar 22, 2016

Hi,

i have just updated to the latest Xcode and iOS SDK9.3 and i get the following error when trying to make:

ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/PrivateFrameworks'
ld: framework not found Preferences

I checked under the location where the PrivateFrameworks is always located and it is not there anymore.
Did the PrivateFrameworks directory move or got deleted in the newest SDK?

@kirb
Copy link
Member

kirb commented Mar 22, 2016

Xcode 7.3 removed all private frameworks from the SDK. For now, please download iOS 9.2 SDK from https://jbdevs.org/sdks/, extract to Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs and set TARGET to use that, or just download Xcode 7.2 again (https://developer.apple.com/downloads/) and use xcode-select to switch to it.

@merdok
Copy link
Author

merdok commented Mar 22, 2016

Thanks! That solved my issue.

@merdok merdok closed this as completed Mar 22, 2016
@kirb
Copy link
Member

kirb commented Mar 23, 2016

Going to reopen this so people coming to report an issue will see it, and becase we do need to find a solution to this.

@mstg
Copy link
Member

mstg commented Mar 31, 2016

Im gonna dump shared cache to generate tbds with my new tool machotbd (thanks to @uroboro for help)
@kirb and I have talked about this, but just noting it here.

@0xdeafcafe
Copy link

0xdeafcafe commented Apr 15, 2016

@kirb When you say set TARGET to use that, I'm not sure exactly what you're referring to. Are you saying set TARGET in the makefile to that directory, or to iPhoneOS9.2.sdk, or something completely different?

@kirb
Copy link
Member

kirb commented Apr 15, 2016

@0xdeafcafe Definitely should have explained that more, sorry.

TARGET is a combination of 4 different configuration options related to the platform being built for. The default is iphone:clang:latest:latest, meaning to build for iOS, using clang, with the latest SDK version, deploying to support iOS versions matching the SDK version, or newer. The second argument is a little useless at the moment as the only possible value is clang (or nothing).

In this case, you should edit ~/.theosrc (which probably doesn’t exist, so create it) and insert something along the lines of:

TARGET = iphone::9.2:9.0

Which indicates that you are building for iOS, using SDK 9.2, and intending to support iOS 9.0 and newer.

@0xdeafcafe
Copy link

@kirb ah perfect. all working now. thanks!

@fiquett
Copy link

fiquett commented Apr 16, 2016

hmm.. ive got xcode 7.3 and i downloaded the 9.0 and 9.2 sdks into the SDKs folder.. and then set my ~/.theosrc to TARGET = iphone::9.2:9.0... but it still is complaining and pointing to the 9.3 SDK on make... hmmm... anywhere else to look?

@fiquett
Copy link

fiquett commented Apr 16, 2016

i think im just going to have to go to xcode 7.0.1. sounds like you cannot run older SDKs with 7.3 ... if i remove the other SDKs temporarily.. the compile complains that 9.0 SDK has been skipped because 9.3 is min version.

@128keaton
Copy link

I'm having the same issue, but I've pointed the TARGET var properly...

@kirb
Copy link
Member

kirb commented Apr 19, 2016

Yeah, something isn’t right… will need to look into it. The alternative is SDKVERSION, as I use in my setup here: kirb/dotfiles@6ad4e38

@snakeninny
Copy link

Seems we don't have this problem with Xcode 7.3.1. Please double check to confirm, thanks!

@kirb
Copy link
Member

kirb commented May 12, 2016

@snakeninny, 7.3.1 didn't bring back private frameworks. If a project successfully links for you, you’re probably just not linking any private frameworks.

@bolencki13
Copy link

bolencki13 commented Jul 17, 2016

https://jbdevs.org/sdks/ appears to be dead. It redirects to youtube. It appears that Xcode 7.2 does not contain the private headers in the SDK anymore either.

@mstg
Copy link
Member

mstg commented Jul 18, 2016

@bolencki13 Here is the replacement site: https://sdks.website

@bolencki13
Copy link

bolencki13 commented Jul 18, 2016

Not sure if I am doing it wrong but the headers still don't seem present in the SDK. I checked iOS 9 and it is still throwing an error with #import <Preferences/Preferences.h>

@kirb
Copy link
Member

kirb commented Jul 18, 2016

@bolencki13, this header indeed does not exist: https://github.com/theos/headers/tree/master/Preferences. You must import each specific class you’re interested in using.

@bolencki13
Copy link

This will require me to add the headers manually into these include rather than through the SDK?

@kirb
Copy link
Member

kirb commented Jul 18, 2016

Private headers were never in the SDK. Public headers are unchanged.

@JesseVelden
Copy link

I'm running theos on iOS 9.3.3 and I got the same error when compiling my preference bundle with ios SDK 9.3:

==> Linking bundle xxxPrefs (armv7)…
ld: framework not found Preferences  
clang-3.7: error: linker command failed with exit code 1 (use -v to see invocation) 

However I included the .h files from https://github.com/theos/headers/tree/master/Preferences and added the Preferences.framework to the PrivateFrameworks folder in the SDK.
Also tried to make clean && make package and added the TARGET to ~/.theosrc
I have to compile with the iOS 9.0 SDK in order to let it work.

@kirb
Copy link
Member

kirb commented Jul 27, 2016

@MegaCookie, yes, this is what this issue is about. Use of the iOS 9.2 SDK or older is the solution for now.

@ZaneH
Copy link

ZaneH commented Aug 14, 2016

After following everything in this thread I still couldn't get my project to compile with Preferences. I had one final solution: Terminate the iPhoneOS9.3.sdk symlink.

After that everything compiled and I can see my preferences in Settings.

@mstg
Copy link
Member

mstg commented Aug 17, 2016

Just published 9.3 sdk with private frameworks.
mstg/iOS-full-sdk

You can place the sdk folder in $THEOS/sdks and do:

SDKVERSION = 9.3
SYSROOT = $(THEOS)/sdks/iPhoneOS9.3.sdk

in ~/.theosrc

@wazowski78
Copy link

wazowski78 commented Sep 13, 2016

Editing ~/.theosrc with vi command, other command line editor is giving errors.

@infused-kim
Copy link

infused-kim commented Jan 30, 2017

Is what is described here still the correct and recommended way of dealing with frameworks?

I want to use the iOS 7 SDK and deploy to iOS 7 and up.

To do that I have:

  • Added 'TARGET = iphone::7.0:7.0' to my makefile (I only want this project to target iOS 7 and not all of them)
  • Downloaded the iOS 7 SDK from sdks.website and placed it in $(THEOS)/sdks/iPhoneOS7.0.sdk
  • Added to .theosrc: SDKVERSION = 7.0
  • Added to .theosrc: SYSROOT = $(THEOS)/sdks/iPhoneOS7.0.sdk

If I leave any of these steps out, it doesn't work.

Is this how I am supposed to set this up?

It seems strange that I am defining what SDK and deployment target I want to use in the makefile, but then have to do it again in the theosrc globally for all projects.

I have also tried THEOS_PLATFORM_SDK_ROOT, but setting it outside of xcode didn't work either.

I would also prefer to keep the SDKs separately from xcode so that I don't have to redownload them every time xcode is updated.

@kirb
Copy link
Member

kirb commented Jan 30, 2017

@KimchaC, yes. Patched SDK (or older SDK) is basically mandatory at this point, unless you avoid linking private frameworks.

At some point I’ll be adding $THEOS/sdks/ to the SDK search path (currently only Xcode.app/…/iPhoneOS.platform/Developer/SDKs/), so after that you’d only need to set the SDK version in $(TARGET).

@infused-kim
Copy link

Thanks, adding $THEOS/sdks/ would be much appreciated.

In case someone else is confused, here is how I set it up without editing theosrc:

  • Added 'TARGET = iphone::7.0:7.0' to my makefile (I only want this project to target iOS 7 and not all of them)
  • Downloaded the iOS 7 SDK from sdks.website and placed it in $(THEOS)/sdks/iPhoneOS7.0.sdk
  • Created a symlink into Xcode's folder: sudo ln -s $THEOS/sdks/iPhoneOS7.0.sdk/ /Applications/Xcode.app//Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/

@crzQag
Copy link

crzQag commented Feb 16, 2017

I followed KimchaC and another error appear:
Your current SYSROOT, “/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk”, appears to be missing. make: *** [before-all] Error 1
Can anyone help me?

@Platypus2
Copy link

Platypus2 commented Feb 19, 2017

That error is because it can't find the sdk. If you tried to make the package before doing all the steps you would have got the same error.

Did you make sure to update the symlink command? I had no problem downloading the 10.1 sdk and creating a symlink with:

sudo ln -s $THEOS/sdks/iPhoneOS10.1.sdk/ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs

Note there isn't a double // between Xcode.app/Contents, and there is a space between iphoneOS10.1sdk/ and /applications.

Make sure theos is up to date as well.

@kirb
Copy link
Member

kirb commented Feb 20, 2017

You should avoid modifying Xcode.app, and I’m pretty sure you can’t anyway as of Xcode 8 when SIP is enabled. Set SDKVERSION and SYSROOT in .theosrc as described in #146 (comment).

@kirb
Copy link
Member

kirb commented Mar 22, 2017

As of bcd16b4, we now scan for SDKs in both Xcode.app and theos/sdks/. There is currently an issue with the logic that determines the latest available SDK, where 10.1 will be seen as older than 9.3 (but 8.4 is older than 9.3 as expected), which will be fun to fix since macOS’s ancient sort doesn’t have the -V flag. Of course, if you’re using the patched iPhoneOS10.1.sdk, while Xcode 8.2 is installed, you’ll still need to manually specify your SDK version using TARGET; otherwise Theos will use iPhoneOS10.2.sdk because it’s newer. This also only applies to iOS targets at this point (see #242).

Despite the bugs, I’m considering this fixed. Will add details on downloading/setting up a patched SDK to the installation wiki page.

@kirb kirb closed this as completed Mar 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests