[TIMOB-17694] iOS: Build fails when Resources has a folder named after the app
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2015-09-01T20:08:58.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | CLI, iOS |
Labels | build, clang, ios |
Reporter | Fokke Zandbergen |
Assignee | Chris Barber |
Created | 2014-09-15T14:34:25.000+0000 |
Updated | 2017-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
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.
But at least it ALWAYS happens if you do have a (non-empty) folder named after the app.
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.
I just got this when I updated a project to use
We're all very curious--why do you name your folders the same as the app name?
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
.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:
Would be good to have this fixed or prevented.
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.
Closing ticket as Won't Fix with reference to the above comments.