4

I'm using the open source Titanium CLI for updating an app that's currently in the Apple app store. It builds and runs in the simulator without any problems using the command

ti build -p ios

When I try to build for the app store I use the command

ti build -p ios -T dist-appstore -R <company> -P <distribution certificate>

and get an error message

[ERROR] titanium_prep failed to run (10) [ERROR] This application cannot be built with the Titanium open source SDK because it is an Appcelerator Platform registered application. Please use the Appcelerator Platform CLI tools or Appcelerator Studio to build this application.

I've unregistered the application with the Appcelerator Platform, but it hasn't corrected the problem. I'm using Titanium Command-Line Interface, CLI version 5.0.6, Titanium SDK version 6.0.0.v20160131225447 and Node version 0.12.7. Any help resolving this would be greatly appreciated.

KerryS
  • 41
  • 2
  • Do you know if the app was created with `appc new` or `ti create`? – Victor Casé Feb 02 '16 at 00:28
  • Check at your `tiapp.xml` if has a property `appc-app-id`, if yes, remove it, clean the project and build it again with `ti create`. I think that will work. – Victor Casé Feb 02 '16 at 00:33
  • The app was created about five years ago with Titanium Studio. I removed the appc-app-id, but got the same error. I then removed all of the acs related properties (e.g. acs-oauth-secret-production), deleted the build folder and ran the command with the same result. – KerryS Feb 03 '16 at 14:59
  • 3
    I had the same problem with an app that I have created a long time ago with `ti create`. At some point, I built the app via `appc` a few times, then decided to stick with the open source Titanium SDK. I could build with `ti` again after deleting the app on the Appcelerator Platform, removing the `appc-app-id` property AND changing the `guid` in `tiapp.xml` and then doing a clean build. I generated a new guid at https://www.guidgenerator.com/online-guid-generator.aspx. Depending on your project, changing the guid may have side effects, but I'm not sure about that. – Philippe Feb 09 '16 at 09:20

3 Answers3

3

There is a migration guide at https://github.com/m1ga/from_zero_to_app/blob/master/appc_to_ti.md

It seems you need to use a GUID that is not registered with appcelerator in the tiapp.xml.

It's also worth removing any <appc-...> or <property name="appc-..."> references to appcelerator services that will be turned off, and set <analytics>false</analytics>

Mark
  • 3,459
  • 1
  • 18
  • 23
2

I'm on a Mac with node 0.12 and I was having the same issue with Titanium SDK 5.X.X, but I have changed it to 4.X.X and now I can compile without errors.

I hope you don't need Titanium SDK 5.X.X. or 6.X.X to make your code run...

gabrielperales
  • 6,935
  • 1
  • 20
  • 19
  • Thanks for the suggestions! I changed the Titanium SDK version to 4.0.0.GA and I'm happy to report that I no longer see the titanium_prep error. Unfortunately, another error pops up after it gets further with the build process. It says "You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64". Apparently, bitcode enabled is not set to true in versions of the SDK prior to 6.X.X. – KerryS Feb 02 '16 at 15:59
  • I'm having a lot of issues making run my code... we should think about switch to *react native* ;-) – gabrielperales Feb 02 '16 at 16:07
  • What I think is that, till version 4.x, ti build worked fine, but from 5.x onwards, we need to use appc command line to perform the build, we cannot use ti build. Incase we need to use ti build, we have to downgrade to 4.x as @gabrielperales mentioned. – Soumya Feb 02 '16 at 19:42
  • I've tried using appc with version 6.0.0 but I can't get past the "the registry server is currently unavailable" error. I've played around with the proxy settings, but that doesn't seem to work either. – KerryS Feb 03 '16 at 02:11
  • appc is not going to let you compile with the flag `dist-appstore` if you don't have a registered version... – gabrielperales Feb 03 '16 at 08:50
2

I met the same problem.

Solution:

  • re-create your app using $ ti create
  • or, just build this app using $appc ti build ...

Long explanation:

Our experience is: don't create ti app using $ appc create, just use $ ti create ...

in China mainland, the appc command is not usable at all because of GFW.

I found the related file is the titanium_prep file, which is binary, I can't see any useful information there.

You can't simply edit tiapp.xml and remove the appc/acs attributes to solve this problem

this problem will not occur if you run your app on IOS simulator.

Also, don't downgrade to Titanium 4.X. That means your app won't run at the latest devices.

Siwei
  • 19,858
  • 7
  • 75
  • 95