Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19818] iOS: Assets missing when building (ad-hoc) from Xcode

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionNeeds more info
Resolution Date2018-04-30T18:06:36.000+0000
Affected Version/sRelease 5.0.2
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterPaul Hollyer
AssigneeChris Barber
Created2015-10-28T10:49:42.000+0000
Updated2018-08-06T17:43:14.000+0000

Description

Several users have reported on the Q&A that when packaging a project for Adhoc/Enterprise via Xcode the assets are not included or at least do not show in ImageViews etc. It works fine if you build from Studio/CLI or if you build to device/sim from Xcode instead of packaging for Adhoc/Enterprise. https://community.appcelerator.com/topic/3426/images-not-loading-xcode-7-appc-5-0/3 http://stackoverflow.com/questions/34830359/appcelerator-application-throwing-app-js-not-found-on-device/34875663#34875663

Comments

  1. Fokke Zandbergen 2015-10-28

    /CC [~hollyerp], [~saurabhgaur_rapidsoft] please add information that would help here instead on the Q&A.
  2. Fokke Zandbergen 2015-10-29

    Also on G+: https://plus.google.com/u/0/112609812701821579988/posts/RZ9Yz7TN6Hb?cfem=1
  3. Chee Kiat Ng 2015-10-29

    Before investigating further, am i right to say this issue only happens if you try to archive via Xcode using the appc-created Xcode project in the build folder? If so, and you are having error for missing files, can you try this? 1. Don't clean in Xcode. 2. Xcode->Preferences 3. Locations->Derived Data->Advanced 4. Select Custom->Relative to Workspace 5. Done. Now go ahead to archive or build or run. Remember, don't clean, otherwise you have to *appc run* again to build the project. And also remember to revert back this change once you are done with the Xcode project and wish to go back to do things in Titanium.
  4. Fokke Zandbergen 2015-10-29

    I'm pretty sure that is the case. Is it something we can fix?
  5. Conny Brunnkvist 2015-11-05

    I'm NOT sure I've got exactly the same issue - but it appears similar enough to document here: I cannot see some of my local images in my app after I switch from Ti SDK *4.1.1 to 5.0.2*, but I am running it in the SIMULATOR. (yeas I have cleaned the build directory) What I find surprising is that some(?), but not all, of the images in the ./app/assets/ folder seem to be missing in the build, and they are not mentioned in the build log output either: *png in ./app/assets/* {noformat} -rw-r--r-- 1 conny staff 258 5 Sep 21:59 app/assets/black_1x1.png -rw-r--r-- 1 conny staff 8859 4 Sep 18:47 app/assets/ppp_icon.png -rw-r--r-- 1 conny staff 9079 21 Sep 07:04 app/assets/ppp_icon_neg.png -rw-r--r-- 1 conny staff 295 5 Sep 22:01 app/assets/redLine@2x.png -rw-r--r--@ 1 conny staff 295 5 Sep 21:53 app/assets/red_1x1.png {noformat} *png in ./build/iphone/build/Products/Debug-iphonesimulator/MyApp.app/* {noformat} -rw-r--r-- 1 conny staff 1193 5 Nov 19:30 build/iphone/build/Products/Debug-iphonesimulator/MyApp.app/AppIcon29x29@2x.png -rw-r--r-- 1 conny staff 1193 5 Nov 19:30 build/iphone/build/Products/Debug-iphonesimulator/MyApp.app/AppIcon29x29@2x~ipad.png -rw-r--r-- 1 conny staff 1935 5 Nov 19:30 build/iphone/build/Products/Debug-iphonesimulator/MyApp.app/AppIcon29x29@3x.png -rw-r--r-- 1 conny staff 1631 5 Nov 19:30 build/iphone/build/Products/Debug-iphonesimulator/MyApp.app/AppIcon40x40@2x.png -rw-r--r-- 1 conny staff 1631 5 Nov 19:30 build/iphone/build/Products/Debug-iphonesimulator/MyApp.app/AppIcon40x40@2x~ipad.png -rw-r--r-- 1 conny staff 2531 5 Nov 19:30 build/iphone/build/Products/Debug-iphonesimulator/MyApp.app/AppIcon40x40@3x.png -rw-r--r-- 1 conny staff 2531 5 Nov 19:30 build/iphone/build/Products/Debug-iphonesimulator/MyApp.app/AppIcon60x60@2x.png -rw-r--r-- 1 conny staff 3672 5 Nov 19:30 build/iphone/build/Products/Debug-iphonesimulator/MyApp.app/AppIcon60x60@3x.png -rw-r--r-- 1 conny staff 36661 5 Nov 19:30 build/iphone/build/Products/Debug-iphonesimulator/MyApp.app/LaunchImage-700-568h@2x.png -rw-r--r-- 1 conny staff 30414 5 Nov 19:30 build/iphone/build/Products/Debug-iphonesimulator/MyApp.app/LaunchImage-700@2x.png -rw-r--r-- 1 conny staff 44869 5 Nov 19:30 build/iphone/build/Products/Debug-iphonesimulator/MyApp.app/LaunchImage-800-667h@2x.png -rw-r--r-- 1 conny staff 91523 5 Nov 19:30 build/iphone/build/Products/Debug-iphonesimulator/MyApp.app/LaunchImage-800-Landscape-736h@3x.png -rw-r--r-- 1 conny staff 90042 5 Nov 19:30 build/iphone/build/Products/Debug-iphonesimulator/MyApp.app/LaunchImage-800-Portrait-736h@3x.png -rw-r--r-- 1 conny staff 258 5 Nov 19:28 build/iphone/build/Products/Debug-iphonesimulator/MyApp.app/black_1x1.png -rw-r--r-- 1 conny staff 295 5 Nov 19:28 build/iphone/build/Products/Debug-iphonesimulator/MyApp.app/redLine@2x.png -rw-r--r-- 1 conny staff 295 5 Nov 19:28 build/iphone/build/Products/Debug-iphonesimulator/MyApp.app/red_1x1.png {noformat} In the above example, why isn't e.g. ppp_icon.png in the build but red_1x1.png is? (o_O)
  6. Christopher.fox 2015-11-16

    I found a solution for the problem. After archiving in XCode all resource files (images, fonts, sound files) were missing. This is how i solved the issue in two steps: Step 1: Grab resource files from debug ipa: * Build a debug version for your iPhone device. * After the app has successfully launched on your iPhone, navigate to the ipa file in the debug build folder. Click right on the file (or cmd-click) and choose to uncompress the file * In the extracted archive find the payload file. Also right click on the file (or cmd-click) and choose to show its contents. * You should now see your resource files and folders. Select all the required files and folders and copy them in some new folder. Step 2: Add files to XCode project * Open the build XCode project with XCode * In the left column right click (or cmd-click) on your project * Choose "Add Files to [project name]" * In the file dialog multiselect your files and folders you copied from the debug ipa in step 1 * That's it. Now archive your product and submit it.
  7. Khalil Sarabey 2015-11-22

    A little update since I've been struggling with this since the release of xcode 7.x. This error only happens when you try to archive with xcode, even if you try to install the app on the device directly from xcode the same thing happens, but else than that everything is working as expected. Weirdly, when I tried Chee Kiat Ng's method, I got the nasty red screen with "could not find the file app.js"
  8. Scott Davenport 2016-01-29

    Sorry for the delay on this...makes sense to fix as soon as we can.
  9. Andrea 2016-03-01

    Hi, I'm not still able to workaround this issue (already updated Xcode Derived Data Preferences and tried to deploy on phone, but the app fires the "app.js not found" error). Environment: Titanium Sdk 5.2.0 and Xcode 7.2. Have you any suggestion? Tx
  10. Vaughan Barwood 2016-06-03

    I have been using this process for 3-4 years now and have only experienced this bug this week. I have tried a lot of work arounds but no joy until now. My issue is trying to supply an xCode project to a client. Here is my fix: * Build your project via Studio for "Distribute - Apple iTunes Store" or "Distribute - AD Hoc/Enterprise" * Goto 'yourproject/build/iphone/' using Finder * If there is an 'assets' folder. Deletes it's contents. If there isn't create one (yourproject/build/iphone/assets') * Copy from your Titanium projects 'Resources' folder all JS files (keep any folder structures you have used to organise). Obviously include you app.js file. * Within the 'yourproject/build/iphone/lib' folder replace the alias's with the originals. These can be found by right clicking and selecting 'Show original' * Open yourproject/build/iphone/yourproject.xcodeproj in Xcode. * Build & run the project within Xcode Now it should build/run not only on your machine but also a teammates or clients. EDIT: Build your project via Studio for "Distribute - Apple iTunes Store" or "Distribute - AD Hoc/Enterprise"
  11. Cillian O'Keeffe 2016-06-20

    Is there any update on this? The above steps do not work for us. This is a crippling bug and needs to be fixed ASAP.
  12. Vaughan Barwood 2016-06-20

    @Cillian What are you exactly trying to achieve and what error are you getting? We've been having to use quite a few work arounds for different scenarios.
  13. Cillian O'Keeffe 2016-06-20

    The issue I have is described in the initial caption: {quote} when packaging a project for Adhoc/Enterprise via Xcode the assets are not included or at least do not show in ImageViews etc.{quote} Your workaround above unfortunately does not work in my case.
  14. Vaughan Barwood 2016-06-20

    If you follow my steps from above up until "Open yourproject/build/iphone/yourproject.xcodeproj in Xcode." Once opened click in the Menu goto File/Add files to "project name". Then navigate to your images/assets/fonts etc. Once added they should appear on the left hand side of xCode in the Project Navigator. Now assets should be included when published or Simulated.
  15. Greg 2016-07-11

    Would really appreciate an update on this? The current workarounds do not lend themselves to an automated build process and are potentially very error prone. Please can this be prioritised for a patch release soon?
  16. Alberto Marcone 2016-07-28

    here we are with another unresolved bug from Appcelerator.
  17. Hans Knöchel 2016-07-28

    As far as I understood, it is no bug. Titanium projects are not meant to be opened in Xcode after being compiled, since the linking is done as part of the distribution process. Editing generated Xcode-projects should not be the best practice to follow, although you need to. In that case, the workaround to copy the assets to Xcode manually works.
  18. Ingo Muschenetz 2016-07-28

    [~albertomarcone] I understand your frustration, but your comment does not add to the discussion. I've re-read all of the comments here again and want to confirm what people are asking for: 1. If you want to do automated builds, use the CLI. It's what we do internally and recomment to others. 2. If you want to give your XCode project to a client, you can follow the workaround noted by Vaughn. Is it you want #2 to be easier? Or is there another use case you are advocating for?
  19. Alberto Marcone 2016-07-28

    sorry about my rant but this is the kind of issue that makes you waste so much time and rethink of all of your life choices that led you to choose for this language. One of our third-party library requires to run a script in the build phases, so it's not something that we do nor *want* to do. Eventually copying the assets in the Xcode project fixed it indeed. Not something that we look forward to do every time there's a new update, but we'll do it since there are not other options. Thank you
  20. Stephen Feather 2016-07-28

    3. Using instruments to find memory leaks in core titanium_mobile code 4. Using xcode debugger to get meaningful error messages in modules
  21. Ingo Muschenetz 2016-07-28

    [~sfeather] Thank you. I assume you _could_ use the workaround for those two, but it's tedious?
  22. Cillian O'Keeffe 2016-07-28

    Same boat as Alberto. This wasn't an issue building from 4.x.x to Xcode 6, so it was introduced along the way.
  23. Ingo Muschenetz 2016-07-28

    To be very clear, I am not trying to brush anyone's concerns aside....I want to make sure I understand what is the issue and what is the proper solution.
  24. Stephen Feather 2016-07-28

    @ingo Exactly. The two I mentioned are particularly more expensive areas of development. (and the memory leaks are not inherit to titanium alone, but to nearly all proxy/abstraction/reflection operations including native android!). Adding what may seem like a minor roadblock by removing previous functionality (whether specifically specified or not), copying assets over into a project, becomes pretty major when compounded by each new build operation. Its why live code refreshes (ti-shadow, liveview, faster-titanium), partial builds (alloy) have such value. Could it be scripted? probably. Adds one more opportunity for something to break though. Yes, the build process of titanium has gotten complex, yes there was a refactor from python to node involved, yes there was the addition of an additional abstraction (alloy) added to the mix, yes apple went and mucked around with temp locations and derived data in xcode (missing app.js, similar issue). I'll counter @hans assertion that its not best practice, with two things: First, the opening of project within xCode was once not only possible, but recommended officially by appcelerator for debugging, both in video content, in training and in the documentation guides. It may not NOW be considered best practice, but was for a very long time. Second, the best practice must be replaced with a new better practice for it to no longer be the best practice. So, what specifically is the new best practice for debugging native language issues?
  25. Morten Hopstad 2016-09-01

    Any news here? Im stuck with this problem and its really causing me a headache. I went for the manual method of copying all the files over to the Xcode project, but now Im struggling with LaunchImages. Appstore won't accept it.
  26. Szabolcs Muranyi 2017-02-22

    here's my solution: – open up a terminal window – change directory to the project's root – execute this command: titanium build --platform ios --build-only --force --force-copy-all – voilà! you get a complete xcode build in your build/iphone folder with all your images, fonts and other stuff included
  27. Eric Merriman 2017-05-22

    [~ewieber] Can you check this out please? Maybe touch base with [~cbarber].
  28. Szymon Machajewski 2017-09-18

    It appears I see the same unexpected functionality. Alloy project, html files in a local asset directory, all files are copied to the iOS simulator device with the exception of the images folder. I have 6.2.0 GA SDK. The app runs in the Simulator, but no images present in the interfaces. It's strange that only images folder isn't copied. I find the folder in assets, in Resources, but not in the Simulator device directory.
  29. Szymon Machajewski 2017-09-18

    Ahh, never mind. This is related to app thinning. In the ios section of tiapp.xml just change true to false: false
  30. Eric Merriman 2018-01-09

    [~cbarber] Can you investigate this one to se if still relevant?
  31. Chris Barber 2018-01-10

    I cannot reproduce. I tested with Xcode 9.2, iOS SDK 11.2, and Titanium SDK 7.0.1.GA for both simulator and ad hoc. I made sure that app thinning was enabled. The generated Xcode project contained the correct image in the asset catalog. The generated .ipa file contained the assets.car file. The ImageView loaded the image just fine.
  32. Eric Merriman 2018-04-30

    [~cbarber] Should we re-close this one then?
  33. Chris Barber 2018-04-30

    I bet I know what's going on. When the app is built from Xcode, the project is cleaned and that wipes out all the Resources that the Titanium build copies into the output directory. Since we don't support building directly from Xcode, this should be changed to "won't fix".
  34. Eric Merriman 2018-08-06

    Closing tickets that need more info from 2015 and earlier. Is this is in error, please reopen.

JSON Source