[TIMOB-2434] Titanium does not detect Iphone Certificate because of non-ascii characters in name
EDIT: It took me an evening, but I found a fix/workaround for this issue. Read the post to see the steps I took to fix it.
Titanium doesn't detect my Iphone Developer Certificate. The "Install Now" button on the "Run on Device" tab is disabled. So I can't install to my Iphone.
My name contains non-ascii characters and I think this could be the reason it doesn't work. I have seen other tickets where people have trouble because of non-ascii characters in their certificates.
I have a proper working certificate and I can install to my Iphone from XCode without problems. I have tried deleting and reinstalling both the WWDR and the Developer Certificate. I have a working provisioning profile.
I'm using v. 1.2.1 of Titanium and the v. 4.2 Iphone SDK.
I checked the prerreq.py script and it seems the keychain dump does not work properly.
I stepped through the script and discovered that the functions looking for the different certificate strings were not finding anything. A closer look revealed that the problem was with the initial keychain dump.
I tried running the dump command from the script in the python
This should give a long string of keys and values, but it just return gives the first couple of rows from the keychain dump.
output = run.run(['security','dump-keychain'],False,False)
The result is cut off just after my name appears. The reason probably being that my name contains non-ascii characters which crashes the string handlers.
To work around this I ran an ordinary keychain dump in
and saved the output to a text file.
security dump-keychain -d login.keychain
I set the prereq.py to read from that file instead of trying to get the dump directly. This seems to solve some of the problems, as the rest of the functions in the prereq.py file now correctly identifies my certificates.
I still can´t install to device though. It seems there is a similar problem with reading the provisioning profile. I haven't tried to work around it yet.
I had made a mistake in reading the keychain file in the script. When I fixed that the certificates were detected in the Titanium GUI and the Install Now button was enabled!
However, when I click Install Now, I get a "Install error", so it still does not work. :(
The build.log contains the following error:
Exception detected in script:
Traceback (most recent call last):
File "/Library/Application Support/Titanium/mobilesdk/osx/1.4.2/iphone/builder.py", line 994, in main
execute_xcode("iphoneos%s" % iphone_version,args,False)
File "/Library/Application Support/Titanium/mobilesdk/osx/1.4.2/iphone/builder.py", line 780, in execute_xcode
for arg in args: o.write(" %s\n" % arg)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 64: ordinal not in range(128)
EDIT 4 - the fix:
Traced that error to the following statement:
o.write("Starting Xcode compile with the following arguments:\n\n") for arg in args: o.write(" %s\n" % arg)
The o.write apparently does not honor the utf-8 encoding in the
file and crashes trying to print my name.
Since the line seemed to be just a log output i commented it out like so:
#for arg in args: o.write(" %s\n" % arg)
And would you believe it...
Now it installs!
Now that wasn't so hard was it?
I hesitate to call this a fix, but at least it's a usable work around.
Happy Non-ASCII:ing to all my fellow Scandinavians (and the rest too of course)!
- Lee Morris 2017-06-08 Closing ticket as there has been no input for the last 6 years. Any problems, please file a new ticket.