Alloy project won't run

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

Hi guys,

I'm starting to play with Alloy a little I've used both npm and github versions of it. Everything went fine with the installation, so I created a new Titanium Studio default template project, went to the command line ran: alloy new, the folder structure got created in my project along with the Alloy "Hello World" app, then I ran alloy compile, everything went fine here too. But when I run the app using alloy run I get the following error messages:

[INFO] Performing clean build
[ERROR] clang: error: linker command failed with exit code 1 (use -v to see invocation)
[ERROR] Error: Traceback (most recent call last):
[INFO] File "/Users/lucian/Library/Application Support/Titanium/mobilesdk/osx/2.1.2.GA/iphone/builder.py", line 1309, in main
[INFO] execute_xcode("iphonesimulator%s" % link_version,["GCC_PREPROCESSOR_DEFINITIONS=__LOG__ID__=%s DEPLOYTYPE=development TI_DEVELOPMENT=1 DEBUG=1 T
I_VERSION=%s %s %s" % (log_id,sdk_version,debugstr,kroll_coverage)],False)
[INFO] File "/Users/lucian/Library/Application Support/Titanium/mobilesdk/osx/2.1.2.GA/iphone/builder.py", line 1215, in execute_xcode
[INFO] output = run.run(args,False,False,o)
[INFO] File "/Users/lucian/Library/Application Support/Titanium/mobilesdk/osx/2.1.2.GA/iphone/run.py", line 41, in run
[INFO] sys.exit(rc)
[INFO] SystemExit: 65
Running alloy run once more, starts the app in the iOS Simulator but the app closes itself right after it displays the splash screen. What am I doing wrong here?

Thanks!

4 Answers

Accepted Answer

OK, we figured out what's going on!

There is a bug in the iPhone build scripts when compiling a project that uses a module, that module is accidentally duplicated in the list of libraries to link with. Furthermore, it only seems happens when the module has a dependency on another native library in which case Xcode finds duplicate symbols from the module's dependencies.

So, to test this, you can remove the offending module from the tiapp.xml, clean the project, and build again. If it works, then you have two options:

1) Discontinue use of the module until the we ship a fix in a couple weeks

2) Hack your builder.py in the Titanium SDK's iphone directory by fixing the Python code to not insert duplicate entries into the module_lib_search_path variable around line 825 and 833

Let me know if the module was the problem. Good luck!

— answered 8 months ago by Chris Barber
answer permalink
7 Comments
  • The only module I have in the test app is:

    <module platform="android" version="1.0">ti.physicalSizeCategory</module>
    ...which is added by alloy. If remove it, alloy adds it back when you run the app. I think the only way to go is option (2).

    Thanks!

    — commented 8 months ago by Lucian Pacurar

  • Shucks. Thought that could have been the issue. OK, when you build for iPhone, look in the <project-dir>/build/iphone/build/build.log at the bottom and see what it was doing just before erroring.

    — commented 8 months ago by Chris Barber

  • Here's the log output: build.log

    — commented 8 months ago by Lucian Pacurar

  • Show 4 more comments

I just tested following your steps and the Hello World app runs for me. Also since alloy new and compile run as expected it appears it's not a path issue. If you not already done so can you npm install the latest Alloy, and try again? Another thing to try is run or debug the Alloy application project from Titanium Studio as you would do in non Alloy projects.

— answered 8 months ago by Russ McMahon
answer permalink
7 Comments
  • I've uninstalled alloy from npm and reinstalled it again, and then I followed my previous steps, and I get the same error. It's weird, I have Mac 10.8.2, Titanium SDK 2.1.2GA, Xcode 4.4.1 and the other apps I'm running are just fine.

    Debugging gets me to the same error. It seems it something related to the build process. Maybe I'm missing some files from Xcode? I see that the error is related to clang.

    — commented 8 months ago by Lucian Pacurar

  • Can you create a project in Titanium studio and run it? It should be the default Tab group sample? If you can then do "alloy new" in the project folder. Then again from from Studio run or debug the project.

    — commented 8 months ago by Russ McMahon

  • Also look in plugins/ti.alloy/plugin.py and make sure the node and alloy path are correct for your machine.

    — commented 8 months ago by Russ McMahon

  • Show 4 more comments

I saw this same error for the first time today. I was unable to figure out exactly what was causing the problem.

For starters, this error is NOT an Alloy specific error. It's not related to a specific version of the Titanium SDK either. It happened for me regardless what SDK version (2.1.1, 2.1.2, 3.0.0). Running clean did not fix the problem either.

I sorta forgot about it for an hour, then I manually ran builder.py from the command line and it worked. After that, I was able to successfully launch my app in the iPhone Simulator. After that, I can run the simulator from Titanium Studio again.

This may be a Titanium Studio bug. I'll keep an eye on it.

I have a couple of projects with alloy in the name (AlloyHunter and alloy_fugitive) and they work fine. I'm running Alloy 0.2.34 with the 2.1.3RC SDK. I haven't upgraded Xcode to v4.5 yet on this machine. I wonder what differs between our setups that I can use "alloy" in the name and you cannot?

— answered 8 months ago by Tim Poulsen
answer permalink
1 Comment
  • Well, it seems it's working now with "alloy2" project name. And as far I can remember it didn't work with other names either. I don't know what was wrong.

    — commented 8 months ago by Lucian Pacurar

Your Answer

Think you can help? Login to answer this question!