Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14492] iOS: clang: error: linker command failed with exit code 1

GitHub Issuen/a
TypeBug
PriorityMedium
StatusReopened
ResolutionUnresolved
Affected Version/sRelease 3.1.1
Fix Version/sn/a
ComponentsiOS
LabelssupportTeam
ReporterBetty Tran
AssigneeChris Barber
Created2013-07-04T13:20:07.000+0000
Updated2018-02-18T20:38:44.000+0000

Description

When building a project to run on the iOS Simulator, it fails with the following error:
[TRACE] :  ld: truncated fat file. Slice from 68 to 84873484 is past end of file with length 53090291 for architecture i386
[TRACE] :  clang: error: linker command failed with exit code 1 (use -v to see invocation)
[ERROR] :  ** BUILD FAILED **
[ERROR] :  The following build commands failed:
[ERROR] :  Ld build/Debug-iphonesimulator/test6.app/test6 normal i386
[ERROR] :  (1 failure)
Note that the customer is able to build their Android projects with no problems. The full log files are attached as follows: - log1: log from building via Titanium Studio - log2: log from build via the CLI - log3: The result of running titanium info I will also be attaching the Studio diagnostic file shortly. The customer started getting this error after creating a new user on his mac and doing a clean install of Titanium Studio and all its updates.

Attachments

FileDateSize
AlloyTest.zip2017-07-20T01:03:48.000+00008051110
ClassicTest.zip2017-07-20T01:03:49.000+00005637073
diagnostics2013-07-04T13:46:26.000+00008182
log12013-07-04T13:20:07.000+0000253146
log22013-07-04T13:20:07.000+00001323097
log32013-07-04T13:20:07.000+000012502

Comments

  1. Betty Tran 2013-07-05

    Tried cleaning the project and building again with no success.
  2. Michael Xia 2013-07-06

    [~ingo] I'm not sure if this is a CLI or an IOS SDK issue. I found one ticket with similar error in TISTUD-723, but cleaning the project didn't help for this customer.
  3. Ingo Muschenetz 2013-07-07

    [~cbarber] Any thoughts?
  4. Moshe Marciano 2013-07-07

    it is important to note that this problem started when we added a user to the same mac, meaning, the first user could build fine, then we added a second user and installed the SDKs, then we got into some trouble. the first one was it was referring to the global /Library/Application Support/Titanium... for the SDKs, once I changed Titanium to Titanium-old, it referred to the user version and started building, but then we got this problem. I wouldn't be surprised if this turns out to be a permission issues, but I dont know where to look.
  5. Chris Barber 2013-07-08

    Hmm, this is an interesting error. For starters, thank you for the great logs! This could very well be a permission issue, a corrupt iOS SDK install, or a corrupt Xcode install. Once upon a time I had a corrupt iOS SDK and was getting really funky errors. I would remove /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk, then go into Xcode > Preferences > Downloads and reinstall the iOS SDK. Then try again to clean and build your project. If you still have problems, I would consider reinstalling Xcode again.
  6. Chris Barber 2014-03-27

    Resolving as cannot reproduce since we've not seen this happen and it sounds like it's a permission issue.
  7. Lee Morris 2017-03-27

    Closing ticket as I am unable to reproduce this issue with the following environment; iPhone 7 (10.2) MacOS 10.11.6 (15G31) Studio 4.8.1.201612050850 Ti SDK 6.0.3 GA Appc NPM 4.2.8 Appc CLI 6.1.0 Ti CLI 5.0.11 Alloy 1.9.5 Arrow 1.10.1 Xcode 8.2 (8C38) Node v4.6.0 Java 1.7.0_80
  8. Joshua Quick 2017-07-20

    I'm able to reproduce this issue with the attached projects: - AlloyTest.zip - ClassicTest.zip *Steps to reproduce:*

    Build attached project "AlloyTest" or "ClassicTest" for iOS.

    Note that the 1st build will succeed.

    If you're using Appcelerator Studio, change the contents of 1 of the files. (This is to trigger another build.)

    Attempt to do another build for iOS.

    *Result:* The build will fail with the following message in the log...
       [TRACE] :  ld: can't open output file for writing: /Users/jquick2/Documents/Appcelerator_Studio_Workspace/ClassicTest/build/iphone/build/Products/Debug-iphonesimulator/ClassicTest.app/ClassicTest, errno=21 for architecture x86_64
       [TRACE] :  clang: error: linker command failed with exit code 1 (use -v to see invocation)
       [ERROR] :  ** BUILD FAILED **
       [ERROR] :  The following build commands failed:
       [ERROR] :  	Ld build/Products/Debug-iphonesimulator/ClassicTest.app/ClassicTest normal x86_64
       [ERROR] :  (1 failure)
       
    Note that all subsequent iOS builds will fail with the above message. *Reason:* This error will happen if a subdirectory has the same name as the iOS app bundle. Also, the subdirectory must contain at least 1 file (cannot be empty) to trigger this issue or else it won't be included in the build. For the attached "ClassicTest" project, it's because it contains the following folder name... - ./Resources/ClassicTest For the attached "AlloyTest" project, it's because it contains the following folder name... - ./app/lib/AlloyTest *Work-Around:* Rename the app bundle to a name not matching a subdirectory name in the "tiapp.xml" file.
       <ti:app xmlns:ti="http://ti.appcelerator.org">
           <name>AppNameToChange</name>
       </ti>
       

JSON Source