Build application, leads to missing libary error

You must Login before you can answer or comment on any questions.

Hi,

I'm writing a code which can be used both for Android and iPhone.

I am coding the unzip function for both platforms, using modules (built using titanium.py as explained in docs).

My modules work without problem, I tested them.

I am on Mac OS X, and the modules are in

/Library/Application\ Support/Titanium/modules/iphone
/Library/Application\ Support/Titanium/modules/android
As they should. They are also declared in the tiapp.xml in project.

But I have a problem when I build the project...

In my code I include the modules using :

var zipmodule = null;
if(Ti.Platform.name == "iPhone OS")
{
  zipmodule = require( "iPhoneZip" );
}
else
{
  zipmodule = require( "androidZip" );
}
and then I would like to test my application, using the following command (which I always use):
/Library/Application\ Support/Titanium/mobilesdk/osx/1.7.0/iphone/builder.py run /Users/me/Documents/MobileApp
I get the error :
Third-party module: androidZip/0.1 missing library at /Library/Application Support/Titanium/modules/android/androidZip/0.1/libandroidzip.a
Which should not happen, because I try to build the iPhone App, but the build.py tries to find the android module...

Is this a bug ?? (because it should not do this, since the building platform is not android, as I tested it before "including" the module.

Did anyone encounter this issue ??

Any ideas for solving it ??

Thanks !

2 Answers

Accepted Answer

Try to add in tiapp.xml the modules specified by it's platform

<modules>
  <module version="0.1" platform="iphone">com.iphonemodule</module>
  <module version="0.1" platform="android">com.androidmodule</module>
</modules>

— answered 2 years ago by Dan Tamas
answer permalink
2 Comments
  • Hi, thanks, this worked !

    — commented 2 years ago by abbdoul ab

  • The build is ok, let me try a few more things, and if I face no issue I will mark this as best answer ;)

    — commented 2 years ago by abbdoul ab

The problem is with the line:

if(Ti.Platform.name == &quot;iPhone OS&quot;)

In my experience, you get back "iphone" or "ipad" and not "iPhone OS".

My suggestion is to reverse the test and use:

if(Ti.Platform.name == &quot;android&quot;)

with the else clause handling the iphone/ipad. Or else a switch statement making it easier to add additional platforms like blackberry too down the road.

— answered 2 years ago by Doug Handy
answer permalink
1 Comment
  • Hi, I found the if clause in the Kitchen Sink, and I already used it in other (for specific UI) parts...

    But even inverting the condition did not resolve the problem

    — commented 2 years ago by abbdoul ab

Your Answer

Think you can help? Login to answer this question!