Xcode 4 & three20 & create IPA archive: No such fi

2020-02-08 16:14发布

In Xcode 3.2.5 I use "Build And Archive" to create an IPA file without any problems. How can I do that in Xcode 4? I think I have to use "Product -> Archive", but I get over 100 error messages in the three20 framework. Most are "No such file or directory". ("Product -> Build For -> Build For Archiving" works. No errors.)

For example, this is the first error message:

../scripts/Protect.command: line 23: cd: /Users/[USERNAME]/Library/Developer/Xcode/DerivedData/[PROJECTNAME]-blabla/ArchiveIntermediates/[PROJECTNAME]/BuildProductsPath/Release-iphoneos/../three20/Three20Core: No such file or directory

The path "/[PROJECTNAME]/BuildProductsPath/three20/" really doesn't exists, but this path exists: "/[PROJECTNAME]/three20/"

What can I do?

12条回答
smile是对你的礼貌
2楼-- · 2020-02-08 16:38

I'm looking into this right now and will hopefully put together an adequate patch that works in both Xcode 3.2.# and Xcode 4.

Edit: So it looks like the easiest way to get old Xcode 3.2 projects to work with Xcode 4 is to do the following:

  • Go into Xcode 4's preferences (Cmd+,).
  • Select the "Locations" tab.
  • Where it says "Build Locations", select the drop down and pick "Place build products in locations specified by targets"

I'll write up a three20.info article going into more details about this.

查看更多
SAY GOODBYE
3楼-- · 2020-02-08 16:40

Make sure your scheme name doesn't contains spaces. That also leads to the "File not found" build error.

查看更多
Deceive 欺骗
4楼-- · 2020-02-08 16:42

Google Groups: Xcode 4, Three20 and Project -> Archive
http://groups.google.com/group/three20/browse_frm/thread/cde36b7dab178bad

查看更多
冷血范
5楼-- · 2020-02-08 16:44

If you want a quick workaround, just do next simple steps:

1. go to the mentioned /Users/[USERNAME]/Library/Developer/Xcode/DerivedData/[PROJECTNAME]-blabla/ArchiveIntermediates/[PROJECTNAME]/BuildProductsPath/ path (it will be in your error message). It should be a substring till /.. in that path.
2. create Release-iphoneos (or Debug-iphoneos if appropriate) folder there

Then everything will build fine!

Three20 script assumes you already have that folder, but when you build first time there is no one exists. That's why you need to fix "Build" and "Archive" separately: "Build" action usually uses Debug-iphoneos folder and "Archive" action uses Release-iphoneos.

Tip: you can create all the required folders at once to avoid problems with different configurations. These are:
Release-iphoneos
Debug-iphoneos
Release-iphonesimulator
Debug-iphonesimulator

查看更多
该账号已被封号
6楼-- · 2020-02-08 16:45

I did the following to make it work for me:

  1. for the three20 static library, I used cocoapods to include the files within the main project.. it just got rid of all the trouble three20 was giving me (and they are lots..) btw i tried replacing three20 with Nimbus.. but Nimbus was lacking on some of the features that my project was using three20 for.. so Nimbus wasn't helpful.
  2. set skip install to yes under build settings for all other sub projects/static libraries and switched the copy headers from public to project under build phases
  3. most importantly: under the sub libraries.. under build phases i ensured that copy files destination was changed from Absolute path to products directory.

and that was it!

hint: to get an idea of the offending files that's causing your archive to create an archive file rather than an ipa do this:

  1. Select the archive and click the Distribute button.
  2. Select the 'Save Built Products' option.
  3. Hit Next and Save.
  4. Browse the created directory in Finder.
  5. The 'libraries' subdirectory will identify the libraries that you need to set the Skip Install to Yes.
  6. in some cases usr/local/include will identify the culprit header files you need to move from Public to Project or the files that you have to change from absolute path to products directory. but that directory (ie usr/local/include) varies depending on your sublibrary directory structure
查看更多
贪生不怕死
7楼-- · 2020-02-08 16:47

Amir Naor's answer is perfect. I verified his answer on xcode 4.2 and it worked. I missed the step "You will need to change the scripts as Manni mentioned above" so I kept getting the similar error as quoted in the original question post. hope you don't make the same mistake. also as of xcode 4.2, the step "then you will also need to change the "Locations" preference in Xcode as featherless mentioned above." isn't needed any more.

查看更多
登录 后发表回答