Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Is there a way to not build un-necessary libraries with Titanium?

Hi,

I opened one of my iPhone projects in Xcode, and I see that there are a lot of library files that mostly my app would not use.

The basic app that I built has around 10 screens and all the logic built in with the DB and does a few Http connects. The rough size of the app to my surprise was 4.3 MB.

I Xcode I saw that there were around 220 Files that were built, is there a way to take out or build without the full library support?

It will greatly improve app performance and no more memory issues of some things not loading properly and some things loading slow.

Let me know guys. FYI, I have not plaed with taking out the libraries and building the app in Xcode, it might help or it might completely render my app useless as I am not sure whats being used and whats not.

THanks,
Arun

— asked August 10th 2010 by Arun Sivaraman
0 Comments

5 Answers

  • This is a great point. And to answer your question, I don't think there's a way.

    I wish you could also exclude all the Android stuff that gets rolled in to your app if you're only targeting the iPhone.

    I hope Appcelerator is wildly successful, but if they fail, it will likely be because they're trying to do too much (iPhone + Android + Blackberry). There's a risk that this undertaking is too involved and will get too complex. I hope not, but as a developer only focused on the iPhone and iPad, I can't help but daydream how much faster Titanium SDK releases could be if the developers weren't spending so much time fixing Android bugs.

    — answered August 10th 2010 by Clifton Labrum
    permalink
    2 Comments
    • See my answer regarding Android stuff not being included in the binary. Also, thanks for the well wishes and concerns, but we feel that being cross-platform is an important feature for Titanium. As our platform continues to mature, we'll see more platform-specific functionality move out into modules that can be revv'ed very quickly, independent of Titanium core.

      — commented August 10th 2010 by Kevin Whinnery
    • That would be a really cool concept when you have platform specific APIs and yeah it would make your lives easier as well :)

      — commented August 26th 2010 by Arun Sivaraman
  • When your actual application binary gets created, only the dependencies you need should be included in your application (determined by checking which Titanium APIs your code uses). Also, there are no cross platform libraries included in your application (for Android or anything else), so there isn't anything included in your binary that is unused by the framework. The binary size is a bit larger than it might otherwise be for a native application since we are shipping a JavaScript interpreter. If you're experiencing performance issues, a test case to reproduce would be very helpful.

    — answered August 10th 2010 by Kevin Whinnery
    permalink
    4 Comments
    • I'm afraid I have to disagree. Perhaps I'm missing something, but as far as I can tell, when you compile an iPhone app, every single part of the Ti API gets compiled into the app, whether or not it's actually being used.

      Case in point, my app uses neither Facebook nor iAds, but they're both compiled into the binary.

      — commented August 22nd 2010 by Josh Dechant
    • Thanks, Kevin. That's very good to know.

      — commented August 22nd 2010 by Clifton Labrum
    • Hey there, I also disagree that this is the case - if you open a titanium generated project in xcode basically the whole farm is in there.

      all kinds of stuff we never used.

      any way of pulling this stuff out pre-build?

      — commented January 27th 2011 by Alex Morris
    • Having the farm of files in the XCode Project does not mean that they are compiled. They are creted by Titanium, but the compilation/build process follows after that. The built tool is clever enough to not include unneccessarz libraries and classes.

      — commented January 27th 2011 by Ray Beyer
  • I am puzzled at this state now. I dont have any dependencies with any libraries from google or yahoo or video or audio processing. But every time I compile the xcode code generated, there are 220 files that are compiled. This is the case of 1.3.0 with 3.2 code and if its 1.4.0 there are 290 files that are being compiled.

    Any pointers to stop that will be greatly appreciated. Also, I have another question on the 1.3.0 to 1.4.0 transition, any pointers on that would also be helpful.

    Thanks,
    Arun

    — answered August 21st 2010 by Arun Sivaraman
    permalink
    0 Comments
  • I am puzzled at this state now. I dont have any dependencies with any libraries from google or yahoo or video or audio processing. But every time I compile the xcode code generated, there are 220 files that are compiled. This is the case of 1.3.0 with 3.2 code and if its 1.4.0 there are 290 files that are being compiled.

    Any pointers to stop that will be greatly appreciated. Also, I have another question on the 1.3.0 to 1.4.0 transition, any pointers on that would also be helpful.

    Thanks,
    Arun

    — answered August 21st 2010 by Arun Sivaraman
    permalink
    0 Comments
  • Any way to remove unused libraries etc that get generated by titanium at build stage?

    If you open a Titanium project in xcode basically the entire farm is in there - making for a massively bloated app.

    — answered January 27th 2011 by Alex Morris
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.