Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3070] Android: Latest 1.6 Distribute Hangs on Windows

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionInvalid
Resolution Date2011-09-07T14:40:44.000+0000
Affected Version/sRelease 1.6.0
Fix Version/sBacklog
ComponentsAndroid
Labels64bit, android, defect, jarsigner, rplist, windows
ReporterDawson Toth
AssigneeDawson Toth
Created2011-04-15T03:35:58.000+0000
Updated2011-09-07T14:41:00.000+0000

Description

Problem

"Distribute" hangs on Windows with any builds after 1.6.0 01/20/11 4:06, verified up to and including the latest as of the creation of this ticket 1.6.0 (02/07/11 11:26 160f5dc...).

Tested On

Newly created project, newly created keystore. Followed guide available at http://developer.appcelerator.com/doc/mobile/android_market">http://developer.appcelerator.com/doc/mobile/android_market to the T (so to speak), multiple times, and was able to replicate the hang every time.
HANGS on Titanium SDK version: 1.6.0 (02/07/11 11:26 160f5dc...)
Customer reports WORKS on Titanium SDK version: 1.6.0 (01/20/11 04:06 githash=16f5a38...), but I do not have that build and so I cannot verify.

Titanium Developer Error Alert

No errors are shown. It simply hangs.

Underlying Command Output

If we run the same builder.py that Titanium Developer is running under the covers, we can get more information. Note that I interrupt the hanging builder.py after waiting for several minutes to see the stack trace. I then LS the build directory to see that the unsigned apk has been generated, but the jarsigner hasn't done its job of signing and copying it to the distribution location. I finish off by verifying that my keystore is valid, using the same keystore and password I entered in Titanium Developer.


W:\>python "C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\builder.py" "distribute" "TestDeploy" "W:\androidsdk" "W:\Code\TestDeploy" "com.dawson.testdeploy" "W:\keystores\android.keystore" "mypassword" "testwindeploy"
"W:\Code\TestDeploy" "7"
[DEBUG] W:\androidsdk\platform-tools\adb.exe start-server
[INFO] Titanium SDK version: 1.6.0 (02/07/11 11:26 160f5dc...)
[INFO] Copying project resources..
[TRACE] Generating Java Classes
[DEBUG] detected module analytics, path = C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-analytics.jar
[DEBUG] detected module android, path = C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-android.jar
[DEBUG] adding required library: titanium.jar
[DEBUG] adding required library: ti-commons-codec-1.3.jar
[DEBUG] adding required library: smalljs.jar
[DEBUG] adding required library: jaxen-1.1.1.jar
[DEBUG] detected module ui, path = C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-ui.jar
[DEBUG] detected module app, path = C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-app.jar
[DEBUG] detected module api, path = C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-api.jar
[DEBUG] detected module filesystem, path = C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-filesystem.jar
[DEBUG] detected module media, path = C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-media.jar
[DEBUG] detected module json, path = C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-json.jar
[DEBUG] detected module locale, path = C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-locale.jar
[DEBUG] Detecting modules in W:\Code\TestDeploy\modules
[DEBUG] Detecting modules in C:\ProgramData\Titanium\modules
[TRACE] Generating W:\Code\TestDeploy\build\android\gen\com\dawson\testdeploy\TestdeployAppInfo.java
[TRACE] Generating W:\Code\TestDeploy\build\android\AndroidManifest.xml
[TRACE] Generating W:\Code\TestDeploy\build\android\gen\com\dawson\testdeploy\TestdeployApplication.java
[TRACE] Generating W:\Code\TestDeploy\build\android\gen\com\dawson\testdeploy\TestdeployActivity.java
[TRACE] Generating W:\Code\TestDeploy\build\android\.classpath
[TRACE] Generating W:\Code\TestDeploy\build\android\.project
[TRACE] Generating W:\Code\TestDeploy\build\android\default.properties
[TRACE] Skipping copying gitignore -> .gitignore because already exists
[DEBUG] detected module analytics, path = C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-analytics.jar
[DEBUG] detected module android, path = C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-android.jar
[DEBUG] adding required library: titanium.jar
[DEBUG] adding required library: ti-commons-codec-1.3.jar
[DEBUG] adding required library: smalljs.jar
[DEBUG] adding required library: jaxen-1.1.1.jar
[DEBUG] detected module ui, path = C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-ui.jar
[DEBUG] detected module app, path = C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-app.jar
[DEBUG] detected module api, path = C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-api.jar
[DEBUG] detected module filesystem, path = C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-filesystem.jar
[DEBUG] detected module media, path = C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-media.jar
[DEBUG] detected module json, path = C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-json.jar
[DEBUG] detected module locale, path = C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-locale.jar
[INFO] Compiling Javascript Resources ...
[DEBUG] Deploy type is production, turning on JS compilation
[INFO] Compiling javascript: app.js
[DEBUG] M:\Programs\Java\jdk1.6.0_02\bin\java.exe -classpath C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\js.jar org.mozilla.javascript.tools.jsc.Main -main-method-class org.appcelerator.titanium.TiScriptRunner -pack
age com.dawson.testdeploy.js -o app -d W:\Code\TestDeploy\build\android\bin\classes W:\Code\TestDeploy\build\android\bin\assets\Resources\app.js
[DEBUG] Processing Android resource drawables
[DEBUG] app stylesheet => W:\Code\TestDeploy\build\android\gen\com\dawson\testdeploy\ApplicationStylesheet.java
[DEBUG] found splash screen at W:\Code\TestDeploy\build\android\bin\assets\Resources\default.png
[DEBUG] Detecting modules in W:\Code\TestDeploy\modules
[DEBUG] Detecting modules in C:\ProgramData\Titanium\modules
[TRACE] Writing out AndroidManifest.xml
[DEBUG] W:\androidsdk\platforms\android-4\tools\aapt.exe package -m -J W:\Code\TestDeploy\build\android\gen -M W:\Code\TestDeploy\build\android\AndroidManifest.xml -S W:\Code\TestDeploy\build\android\res -I W:\androidsdk\plat
forms\android-4\android.jar
[DEBUG] Building Java Sources: "W:\\Code\\TestDeploy\\build\\android\\gen\\com\\dawson\\testdeploy\\ApplicationStylesheet.java" "W:\\Code\\TestDeploy\\build\\android\\gen\\com\\dawson\\testdeploy\\R.java" "W:\\Code\\TestDeplo
y\\build\\android\\gen\\com\\dawson\\testdeploy\\TestdeployActivity.java" "W:\\Code\\TestDeploy\\build\\android\\gen\\com\\dawson\\testdeploy\\TestdeployAppInfo.java" "W:\\Code\\TestDeploy\\build\\android\\gen\\com\\dawson\\t
estdeploy\\TestdeployApplication.java"
[DEBUG] M:\Programs\Java\jdk1.6.0_02\bin\javac.exe -encoding utf8 -classpath W:\androidsdk\platforms\android-4\android.jar;C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\titanium.jar;C:\ProgramData\Titanium\mobilesdk\w
in32\1.6.0\android\ti-commons-codec-1.3.jar;C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-app.jar;C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-android.jar;C:\ProgramData\Tita
nium\mobilesdk\win32\1.6.0\android\modules\titanium-filesystem.jar;C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\jaxen-1.1.1.jar;C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\smalljs.jar;C:\ProgramData\Titaniu
m\mobilesdk\win32\1.6.0\android\modules\titanium-locale.jar;C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-api.jar;C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-json.jar;C:\Pro
gramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-analytics.jar;C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-ui.jar;C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titani
um-media.jar -d W:\Code\TestDeploy\build\android\bin\classes -sourcepath W:\Code\TestDeploy\build\android\src -sourcepath W:\Code\TestDeploy\build\android\gen @c:\users\dawson\appdata\local\temp\tmpjpyg6z
[INFO] Compiling Android Resources... This could take some time
[DEBUG] M:\Programs\Java\jdk1.6.0_02\bin\java.exe -Xmx1024M -Djava.ext.dirs=W:\androidsdk\platforms\android-4\tools -jar W:\androidsdk\platforms\android-4\tools\lib\dx.jar --dex --output=W:\Code\TestDeploy\build\android\bin\c
lasses.dex W:\Code\TestDeploy\build\android\bin\classes C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\titanium.jar C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\ti-commons-codec-1.3.jar C:\ProgramData\Titanium
\mobilesdk\win32\1.6.0\android\modules\titanium-app.jar C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-android.jar C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-filesystem.jar
C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\jaxen-1.1.1.jar C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\smalljs.jar C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-locale.jar C:\Prog
ramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-api.jar C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-json.jar C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-an
alytics.jar C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-ui.jar C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-media.jar
[DEBUG] W:\androidsdk\platforms\android-4\tools\aapt.exe package -f -M AndroidManifest.xml -A W:\Code\TestDeploy\build\android\bin\assets -S res -I W:\androidsdk\platforms\android-4\android.jar -I C:\ProgramData\Titanium\mobi
lesdk\win32\1.6.0\android\titanium.jar -F W:\Code\TestDeploy\build\android\bin\app.ap_
[DEBUG] creating unsigned apk: W:\Code\TestDeploy\build\android\bin\app-unsigned.apk
[DEBUG] from resource zip => assets/Resources/KS_nav_ui.png
[DEBUG] from resource zip => assets/Resources/KS_nav_views.png
[DEBUG] from resource zip => assets/Resources/app.js
[DEBUG] from resource zip => assets/Resources/appicon.png
[DEBUG] from resource zip => assets/Resources/default.png
[DEBUG] from resource zip => assets/tiapp.xml
[DEBUG] from resource zip => res/drawable/appicon.png
[DEBUG] from resource zip => res/drawable/background.png
[DEBUG] from resource zip => AndroidManifest.xml
[DEBUG] from resource zip => resources.arsc
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\titanium.jar => org/apache/Commons-NOTICE.txt
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\titanium.jar => org/apache/HttpComponents-NOTICE.txt
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\titanium.jar => org/apache/mime4j-NOTICE.txt
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\titanium.jar => org/appcelerator/titanium/bindings/titanium.json
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\titanium.jar => org/appcelerator/titanium/build.properties
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\titanium.jar => org/appcelerator/titanium/res/drawable/background.png
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\titanium.jar => org/appcelerator/titanium/res/drawable/btn_check_buttonless_on.png
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\titanium.jar => org/appcelerator/titanium/res/drawable/btn_check_buttonless_on_18.png
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\titanium.jar => org/appcelerator/titanium/res/drawable/btn_check_buttonless_on_48.png
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\titanium.jar => org/appcelerator/titanium/res/drawable/btn_more.png
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\titanium.jar => org/appcelerator/titanium/res/drawable/btn_more_18.png
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\titanium.jar => org/appcelerator/titanium/res/drawable/btn_more_48.png
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\titanium.jar => org/appcelerator/titanium/res/drawable/btn_picker_normal.9.png
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\titanium.jar => org/appcelerator/titanium/res/drawable/btn_picker_pressed.9.png
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\titanium.jar => org/appcelerator/titanium/res/drawable/btn_picker_selected.9.png
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\titanium.jar => org/appcelerator/titanium/res/drawable/default_icon.png
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\titanium.jar => org/appcelerator/titanium/res/drawable/photoDefault.png
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-app.jar => org/appcelerator/titanium/bindings/app.json
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-android.jar => org/appcelerator/titanium/bindings/android.json
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-filesystem.jar => org/appcelerator/titanium/bindings/filesystem.json
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\smalljs.jar => org/mozilla/javascript/resources/Messages.properties
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\smalljs.jar => org/mozilla/javascript/resources/Messages_fr.properties
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-locale.jar => org/appcelerator/titanium/bindings/locale.json
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-api.jar => org/appcelerator/titanium/bindings/api.json
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-json.jar => org/appcelerator/titanium/bindings/json.json
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-analytics.jar => org/appcelerator/titanium/bindings/analytics.json
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-ui.jar => org/appcelerator/titanium/bindings/ui.json
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-ui.jar => ti/modules/titanium/ui/widget/searchbar/cancel.png
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-ui.jar => ti/modules/titanium/ui/widget/webview/binding.js
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-ui.jar => ti/modules/titanium/ui/widget/webview/binding.min.js
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-ui.jar => ti/modules/titanium/ui/widget/webview/json2.js
[DEBUG] from JAR C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\modules\titanium-media.jar => org/appcelerator/titanium/bindings/media.json
[DEBUG] M:\Programs\Java\jdk1.6.0_02\bin\jarsigner.exe -keypass mypassword -keystore W:\keystores\android.keystore -signedjar W:\Code\TestDeploy\TestDeploy.apk W:\Code\TestDeploy\build\android\bin\app-unsigned.apk testwindeplo
y

*** NOTE the execution hangs at this point; I wait several minutes, then hit Ctrl+C, to see this error... ***


[ERROR] Exception occured while building Android project:
[ERROR] Traceback (most recent call last):
[ERROR]   File "C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\builder.py", line 1639, in <module>
[ERROR]     s.build_and_run(True, avd_id, key, password, alias, output_dir)
[ERROR]   File "C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\builder.py", line 1519, in build_and_run
[ERROR]     launched, launch_failed = self.package_and_deploy()
[ERROR]   File "C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\builder.py", line 1154, in package_and_deploy
[ERROR]     output = run.run([self.jarsigner, '-keypass', self.keystore_pass, '-keystore', self.keystore, '-signedjar', app_apk, unsigned_apk, self.keystore_alias])
[ERROR]   File "C:\ProgramData\Titanium\mobilesdk\win32\1.6.0\android\run.py", line 36, in run
[ERROR]     (so,se) = subprocess.Popen(args, stderr=subprocess.PIPE, stdout=subprocess.PIPE).communicate()
[ERROR]   File "W:\Python26\lib\subprocess.py", line 671, in communicate
[ERROR]     return self._communicate(input)
[ERROR]   File "W:\Python26\lib\subprocess.py", line 894, in _communicate
[ERROR]     stdout_thread.join()
[ERROR]   File "W:\Python26\lib\threading.py", line 634, in join
[ERROR]     self.__block.wait()
[ERROR]   File "W:\Python26\lib\threading.py", line 237, in wait
[ERROR]     waiter.acquire()
[ERROR] KeyboardInterrupt

W:\>ls W:\Code\TestDeploy\build\android\bin\
app-unsigned.apk  app.ap_  app.apk  assets  classes  classes.dex

W:\>keytool -list -v -keystore W:\keystores\android.keystore
Enter keystore password:

Keystore type: JKS
Keystore provider: SUN

Your keystore contains 1 entry

Alias name: testwindeploy
Creation date: Feb 7, 2011
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=Dawson Toth, OU=Customer Engineering, O="Appcelerator, Inc.", L=Chicago, ST=IL, C=US
Issuer: CN=Dawson Toth, OU=Customer Engineering, O="Appcelerator, Inc.", L=Chicago, ST=IL, C=US
Serial number: 4d506296
Valid from: Mon Feb 07 15:22:30 CST 2011 until: Thu Mar 21 16:22:30 CDT 2041
Certificate fingerprints:
         MD5:  66:38:74:92:51:E6:14:31:5D:D8:7F:11:EC:68:D1:61
         SHA1: CD:B7:D6:21:D5:81:CB:BD:3F:B9:A4:94:3C:C3:67:C4:09:AA:63:F9
         Signature algorithm name: SHA1withRSA
         Version: 3


*******************************************
*******************************************

W:\>

Associated Helpdesk Ticket

http://developer.appcelerator.com/helpdesk/view/70081">http://developer.appcelerator.com/helpdesk/view/70081

Comments

  1. Dawson Toth 2011-04-15

    I neglected to mention what platform I was testing on.

    Platform Tested On

    Windows 7 Professional, 64-bit

  2. Dawson Toth 2011-04-15

    It appears to be hanging because of my jarsigner. I also have a 64-bit JDK, which is not supported. Specifically, the jarsigner ignores any storepass and keypass arguments, and always asks for the user to enter the password. Our build scripts wait for it to sign the jar, while it waits for the build scripts to enter the password.

    Downloading a 32-bit JDK to see if this resolves this issue.

  3. Dawson Toth 2011-04-15

    Verified. I switched to the 32-bit JDK, regenerated my keystore, and it no longer hangs.

    Should this ticket be marked as invalid, now? Or resolved...

  4. Dawson Toth 2011-04-15

    After changing to 32-bit, the customer's builds were still hanging. I had him hack his builder.py, renaming "storepass" to "keypass", and that fixed the hang for him.

    Is it alright if we take a shotgun approach to the jarsigner, pass in storepass AND keypass, and write the password to STDIN if we haven't heard anything from the jarsigner after several seconds?

  5. Dawson Toth 2011-04-15

    This is also caused by the customer having a key password different from their keystore password. Do we need to revisit this bit of code and let the user specify both passwords?

  6. Dawson Toth 2011-04-27

    Just want to double check if there is anything that needs to be done on this one; I don't think we can fix the issue that prevents the 64-bit jarsigner from working because it seems to ignore everything on STDIN, requiring the user to provide keyboard input of their password. Unless we could simulate the user inputting a password with our scripting. Past that, I'm guessing this can be closed.
  7. Dawson Toth 2011-09-07

    64-bit SDK isn't supported.
  8. Dawson Toth 2011-09-07

    Why Dawson, I completely agree with you. How quaint.

JSON Source