Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17694] iOS: Build fails when Resources has a folder named after the app

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionWon't Fix
Resolution Date2015-09-01T20:08:58.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsCLI, iOS
Labelsbuild, clang, ios
ReporterFokke Zandbergen
AssigneeChris Barber
Created2014-09-15T14:34:25.000+0000
Updated2017-03-23T22:34:35.000+0000

Description

If the Resources folder contains a (non-empty) folder whose name is the same as the name of the app set in tiapp.xml under <name /> then builds will fail crashing:
[TRACE] Ld build/Debug-iphonesimulator/folder.app/folder normal i386
[TRACE]     cd /Users/fokkezb/dev/tests/folderx/build/iphone
[TRACE]     export IPHONEOS_DEPLOYMENT_TARGET=6.0
[TRACE]     export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
[TRACE]     /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk -L/Users/fokkezb/dev/tests/folderx/build/iphone/build/Debug-iphonesimulator -L/Users/fokkezb/dev/tests/folderx/build/iphone/lib -L/Users/fokkezb/dev/tests/folderx/build/iphone/Classes/APSAnalytics -L/Users/fokkezb/dev/tests/folderx/build/iphone/Classes/APSHTTPClient -F/Users/fokkezb/dev/tests/folderx/build/iphone/build/Debug-iphonesimulator -filelist /Users/fokkezb/dev/tests/folderx/build/iphone/build/folder.build/Debug-iphonesimulator/folder.build/Objects-normal/i386/folder.LinkFileList -dead_strip -Xlinker -objc_abi_version -Xlinker 2 -ObjC -weak_framework iAd -weak_framework iAd -fobjc-link-runtime -Xlinker -no_implicit_dylibs -stdlib=libstdc++ -mios-simulator-version-min=6.0 -lAPSAnalytics -weak_framework CoreText -framework EventKit -framework EventKitUI -weak_framework Security -licucore -framework Foundation -weak_framework UIKit -framework CoreGraphics -weak_framework AddressBook -framework AddressBookUI -framework CFNetwork -framework CoreLocation -weak_framework MapKit -framework MessageUI -framework MobileCoreServices -framework OpenGLES -framework QuartzCore -framework SystemConfiguration -lsqlite3 -lz -framework AudioToolbox -weak_framework MediaPlayer -framework AVFoundation -lxml2 -framework StoreKit -lTiCore -lAPSHTTPClient -framework ExternalAccessory -ltiverify -lti_ios_debugger -lti_ios_profiler -Xlinker -dependency_info -Xlinker /Users/fokkezb/dev/tests/folderx/build/iphone/build/folder.build/Debug-iphonesimulator/folder.build/Objects-normal/i386/folder_dependency_info.dat -o /Users/fokkezb/dev/tests/folderx/build/iphone/build/Debug-iphonesimulator/folder.app/folder
[TRACE] ld: warning: instance method 'sqliteDB' in category from /Users/fokkezb/dev/tests/folderx/build/iphone/build/folder.build/Debug-iphonesimulator/folder.build/Objects-normal/i386/PLSqliteDatabase.o overrides method from class in /Users/fokkezb/dev/tests/folderx/build/iphone/build/folder.build/Debug-iphonesimulator/folder.build/Objects-normal/i386/PLSqliteDatabase.o
[TRACE] ld: can't open output file for writing: /Users/fokkezb/dev/tests/folderx/build/iphone/build/Debug-iphonesimulator/folder.app/folder, errno=21 for architecture i386
[TRACE] clang: error: linker command failed with exit code 1 (use -v to see invocation)
[ERROR] 2014-09-15 16:31:51.381 xcodebuild[38883:1596530]  DeveloperPortal: Using pre-existing current store at URL (file:///Users/fokkezb/Library/Developer/Xcode/DeveloperPortal%206.0.db).
[ERROR] ** BUILD FAILED **
[ERROR] The following build commands failed:
[ERROR]         Ld build/Debug-iphonesimulator/folder.app/folder normal i386
[ERROR] (1 failure)
This issue has been reported before on Q&A: https://developer.appcelerator.com/question/131687/project-cant-run-on-simulator

Solution

Ideally it should work, but if it doesn't, then it would be nice if the CLI refuse to build the project, asking to rename the folder. In Studio a warning could also be given when a user wants to create the folder.

Comments

  1. Chris Barber 2014-09-15

    We just saw this same error on [~oromero]'s machine and her project does NOT have a resource with the app's name. I think there's something else going on.
  2. Fokke Zandbergen 2014-09-16

    But at least it ALWAYS happens if you do have a (non-empty) folder named after the app.
  3. kosso 2014-11-30

    I'm also seeing this with 3.4.1.GA It appears to be related to some modules that need updating too. But I can't figure out what to change in the module xCode project build settings to fix it and rebuild a working module.
  4. Jeff Bonnes 2015-01-27

    I just got this when I updated a project to use 7.0. If I remove that from tiapp.xml, it compiles as expected, but I think it is related to the Google Analytics module I am using? {noformat} [TRACE] ld: in /Developer/code/cua-deposify/app/deposify/modules/iphone/analytics.google/1.0/libanalytics.google.a(GAITransaction.o), too many compact unwind infos in function anon for architecture i386 [TRACE] clang: error: linker command failed with exit code 1 (use -v to see invocation) [ERROR] 2015-01-27 15:55:51.632 xcodebuild[84040:6203] DeveloperPortal: Using pre-existing current store at URL (file:///Users/jeff/Library/Developer/Xcode/DeveloperPortal%206.1.1.db). [ERROR] ** BUILD FAILED ** [ERROR] The following build commands failed: [ERROR] Ld build/Debug-iphonesimulator/Deposify.app/Deposify normal i386 [ERROR] (1 failure) {noformat}
  5. Ingo Muschenetz 2015-02-13

    We're all very curious--why do you name your folders the same as the app name?
  6. Fokke Zandbergen 2015-02-13

    I don't, but I debugged 2 apps for clients that did. Mostly classic projects where they had all app-specific lib files under Resources/appname, e.g. Resources/appname/settings.js.
  7. Fokke Zandbergen 2015-03-30

    Just ran into this bug again because I was doing an example app called "images" and of course it had an "images" asset folder as well. Nowadays the error is a bit different:
       [TRACE] error: unable to open executable ''
       [ERROR] ** BUILD FAILED **
       [ERROR] The following build commands failed:
       [ERROR]         GenerateDSYMFile build/Debug-iphonesimulator/Images.app.dSYM build/Debug-iphonesimulator/Images.app/Images
       [ERROR] (1 failure)
       
    Would be good to have this fixed or prevented.
  8. Chris Barber 2015-09-01

    This is no longer allowed. The app name is added to the list of blacklisted files/folders in the Resources directory. If you try to build an app "foo" with a directory "foo" in the Resources dir, you'll see the following error and the build will exit.
       [ERROR] Found blacklisted directory in the Resources directory
       [ERROR] The directory "foo" is a reserved directory.
       [ERROR] You must rename this directory to something else.
       
  9. Lee Morris 2017-03-23

    Closing ticket as Won't Fix with reference to the above comments.

JSON Source