Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27266] Titanium "Failed to encrypt JavaScript files" error on >=8.0.1.GA on Windows when using 32 bit java

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2019-08-28T11:11:28.000+0000
Affected Version/sRelease 8.0.1, Release 8.0.2
Fix Version/sRelease 8.1.1
ComponentsCLI
LabelsTitanium, engReviewed, regression
ReporterYahya Uddin
AssigneeEwan Harris
Created2019-07-20T23:10:26.000+0000
Updated2019-08-28T11:11:28.000+0000

Description

There is a bug on Titanium 8.0.1.GA & 8.0.2.GA, where when running a simple compile:
ti run -p android -T device
Gives the error:
[INFO]  Encrypting JavaScript files: C:\ProgramData\Titanium\mobilesdk\win32\8.0.1.GA\android\titanium_prep.win32.exe "com.example.sandbox" "C:\path\to\project\build\android\assets" "--file-listing" "C:\path\to\project\build\android\titanium_prep_listing.txt"
[ERROR] Failed to encrypt JavaScript files
[ERROR]
I narrowed down the issue to changes made to *titanium_prep.win32.exe*. Looking at the history: https://github.com/appcelerator/titanium_mobile/commits/master/support/android/titanium_prep.win32.exe It seems that one of the 2 commits to be blamed are: https://github.com/appcelerator/titanium_mobile/commit/3eaf55c596402078321632c682549428b7c57371#diff-81660f9ac67f928cddca3a1e35855580 or https://github.com/appcelerator/titanium_mobile/commit/86b3fc01230a0ec09c0b2577a3e68c1e488e48b1#diff-81660f9ac67f928cddca3a1e35855580 A temp workaround is to copy the *titanium_prep.win32.exe* and *titanium_prep.win64.exe* from 8.0.0.GA and replace the ones in the newer 8.0.1.GA or 8.0.2.GA.

Comments

  1. Rakhi Mitro 2019-07-22

    Hello, Thanks for sharing with us. Can you please create a new app, run this on 8.0.2.GA and let us know how it goes.
  2. Yahya Uddin 2019-07-22

    Yes this occured on a hello world app for version 8.0.2.GA as well. But copying over the *titanium_prep.win32.exe* from an older version fixed the issue
  3. Ewan Harris 2019-07-22

    Thanks for the report [~yahya12], I can reproduce this and it looks to be specific to using 32 bit Java
  4. Ewan Harris 2019-07-30

    [~rmitro], they appear to be using 64-bit java based off their log, could we have a new ticket for that issue with full logs from the build. [~nsalahin], I don't believe we have any updates currently. If possible we would recommend the user to move to a 64bit java is possible.
  5. Ewan Harris 2019-08-09

    titanium_prep: https://github.com/appcelerator/titanium_prep/pull/35
  6. Ewan Harris 2019-08-12

    titanium_mobile master: https://github.com/appcelerator/titanium_mobile/pull/11136 I'm not sure where else we want this to land, it's a regression from 8.0.1.GA onwards
  7. Ewan Harris 2019-08-19

    8_1_X: https://github.com/appcelerator/titanium_mobile/pull/11155 8_3_X: https://github.com/appcelerator/titanium_mobile/pull/11159
  8. Ewan Harris 2019-08-20

    Note for this ticket, we made our default settings for d8 and javac max memory incompatible with 32-bit java in TIMOB-26898. If you absolutely must use Java 8 32 bit (Java 9+ is 64 bit only), you must set the following.
       [appc] ti config android.javac.maxMemory 1024M
       [appc] ti config android.dx.maxMemory 1024M
       
  9. Samir Mohammed 2019-08-20

    Using the instructions mentioned by Ewan above I am able to verify the fix on SDK Version 8.2.0.v20190819090550. FR Also passed for 8_1_X and 8_3_X.
  10. Christopher Williams 2019-08-20

    Merged to master and 8_3_X. Waiting on rebuild for 8_1_X...
  11. Christopher Williams 2019-08-20

    Merged to 8_1_X
  12. Samir Mohammed 2019-08-28

    Using the above instructions also able to verify the fix on SDK version 8.1.1.v20190827142754 and SDK version 8.2.0.v20190819090550 *Test and other information can be found at:* Master: https://github.com/appcelerator/titanium_mobile/pull/11136 8_1_X: https://github.com/appcelerator/titanium_mobile/pull/11155 8_3_X: https://github.com/appcelerator/titanium_mobile/pull/11159

JSON Source