Description
We've seen a number of people having issues around the titanium_prep executables stripped of their executable permissions (AC-6376, and slack). We should try and check these on download just incase they get lost somehow
This is fixable by running
iOS:
chmod +x ~/Library/Application\ Support/Titanium/mobilesdk/osx/<SDK VERSION>/iphone/titanium_prep
Android:
chmod +x /~/Library/Application\ Support/Titanium/mobilesdk/osx/<SDK VERSION>/android/titanium_prep.macos
This commonly manifests in the following kind of errors
\[ERROR\] Error: spawn EACCES
2019-09-23T17:39:47.317Z | ERROR | An uncaught exception was thrown!
Cannot read property 'replace' of undefined
2019-09-23T17:39:47.318Z | ERROR | Cannot read property 'replace' of undefined
[ERROR] : TypeError: Cannot read property 'on' of undefined
cc [~cb1kenobi], what're your thoughts on this? It's a bandaid fix, but this seems to be random. It happens to people who install via Studio, the CLI itself, and even VS Code (which uses titaniumlib and not the CLI to install). I've had absolutely no luck in reproducing, and due to the low number of people that seem to have hit this I don't see it being an issue with the actual SDK we're shipping but maybe something on the machines sniping them
There are issues [years ago] with Node-based zip libraries with preserving the executable flag for both creating and extracting zip files which is part of the reason we use adm-zip (and recently yauzl) to unzip and archiver to zip. I would be very interested in inspected the actual SDK zip files to ensure the executables are indeed flags as executable as well as look into titaniumlib's SDK extraction to see what's going on.
The zip file itself is definitely fine (I checked it), and https://github.com/appcelerator/titanium_mobile/pull/10835 fixes any errors in copying over from Jenkins. After some further work I was able to repro in atom/vs code, we use titaniumlib there so I guess that's my port of call tomorrow to see whether that is extracting ok
It's unfortunate that the executable flag is not be honored and that PR was necessary. Are you using the latest titaniumlib in the Atom/VS Code plugins? Perhaps you're dealing with a bugged, outdated dependency?
[~cbarber], we're using 1.x but I can confirm I'm seeing the same on 2.x
Probably yauzl https://github.com/thejoshwolfe/yauzl/issues/101
OK, I follow now. So we need to get the entry's file "mode" and set it after writing it. We do not do this currently in titaniumlib, we just continue to the next entry: https://github.com/appcelerator/titaniumlib/blob/master/src/util.js#L133.
I'm one of the 'lucky' ones. I got this error by downloading the sdk from the cli and manually (stopped using Studio years ago). Chmod +x didn't help. I really don't know how to fix it.
Here's the titaniumlib PR that fixes the Atom plugin and Titanium daemon plugin: https://github.com/appcelerator/titaniumlib/pull/17. node-appc (used by
ti sdk install
) should already be good to go: https://github.com/appcelerator/node-appc/blob/master/lib/zip.js#L59.[~a.marcone], can you paste the error you're seeing into this ticket so we can try to help solve it
I actually dug a little deeper on the issue, and it's not the same thing
and the replace mentioned is actually about assets:
I worked aroud that and it's all good now. Thank you
I seem to have encountered the same issue as Alberto (same error as his Oct 1 comment). I removed all graphics that contained a tilde (~) in their name and now my app will build. TiSDK 8.3.0.GA, Alloy 1.14.5, Titanium CLI v5.2.2, and with Node I tried with versions 12.13, 10.18, and 8.17. Per a recommendation in TiSlack, I downgraded from XCode 11.3 to 11.2 but that didn't help.