Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16073] Android: Failed to encrypt JavaScript files (Windows)

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2013-12-28T00:18:40.000+0000
Affected Version/sn/a
Fix Version/sRelease 3.2.1, Release 3.3.0
ComponentsAndroid
LabelsAlloy, Android, Encrypt, Windows, module_build, qe-testadded, triage
ReporterSam Robertson
AssigneeAllen Yeung
Created2013-12-22T14:11:11.000+0000
Updated2014-06-23T13:19:42.000+0000

Description

Steps to reproduce

Upgraded Titanium Studio to 3.2.0 GA from 3.1.3 GA, including upgrade for Alloy to 1.3.0.

Created new Mobile App Project - Default Alloy Project.

Attempted to Run the project on an Android device. Received the following error during project build:

[INFO] :   Alloy compiler completed successfully
[INFO] :   Processing JavaScript files
[INFO] :   Encrypting JavaScript files: C:\Users\rsam\AppData\Roaming\Titanium\mobilesdk\win32\3.2.0.GA\android\titanium_prep.win32.exe "com.smartkom.test2" "C:\Android\appcelerator\Test2\build\android\assets" "app.js" "alloy/backbone.js" "alloy/CFG.js" "alloy/constants.js" "alloy/controllers/BaseController.js" "alloy/controllers/index.js" "alloy/styles/index.js" "alloy/sync/localStorage.js" "alloy/sync/properties.js" "alloy/sync/sql.js" "alloy/underscore.js" "alloy/widget.js" "alloy.js" "_app_props_.json"
[INFO] :   Encrypting JavaScript files: C:\Users\rsam\AppData\Roaming\Titanium\mobilesdk\win32\3.2.0.GA\android\titanium_prep.win64.exe "com.smartkom.test2" "C:\Android\appcelerator\Test2\build\android\assets" "app.js" "alloy/backbone.js" "alloy/CFG.js" "alloy/constants.js" "alloy/controllers/BaseController.js" "alloy/controllers/index.js" "alloy/styles/index.js" "alloy/sync/localStorage.js" "alloy/sync/properties.js" "alloy/sync/sql.js" "alloy/underscore.js" "alloy/widget.js" "alloy.js" "_app_props_.json"
[ERROR] :  Failed to encrypt JavaScript files
[ERROR] Application Installer abnormal process termination. Process exit value was 1
Note: this procedure worked fine on my system prior to upgrading Titanium/Alloy. Also my previously developed apps, which worked fine, are demonstrating the same behavior now on the new Titanium/Alloy.

Workaround

Please try downloading the .zip file attached to the ticket (titanium_prep-mt.zip) and unzipping it into: C:\path\to\Titanium\mobilesdk\win32\3.2.0.GA\android

Attachments

FileDateSize
.log2013-12-22T14:11:11.000+00002746
mrahman_logs2013-12-23T04:48:24.000+000021928
titanium_prep-mt.zip2013-12-26T22:51:51.000+000068307
Titanium 3.2.0 diagnostic log.txt2013-12-22T14:11:11.000+000015226
trace.txt2013-12-23T04:48:24.000+000013085

Comments

  1. Sam Robertson 2013-12-22

  2. Vince Bullinger 2013-12-23

    Just upgraded this morning. Exact same issue here. Restarted Titanium Studio, my machine, etc. to no avail. I also have the same response from ti info -t jdk as Sam. This is big. Please figure this out immediately. EDIT: I'm using Windows 7, SP1. Java version is 1.7.0_45. I have the same error message. Oops? http://docs.appcelerator.com/titanium/3.0/#!/guide/Installing_Oracle_JDK
  3. Ingo Muschenetz 2013-12-23

    Hi All, If you are experiencing this issue, please make very clear:

    Which version of Windows (version, 32-bit or 64-bit)

    Which version of Java (version, 32-bit or 64-bit)

  4. Chris Barber 2013-12-23

    +1 to Ingo's comment above. We need to know EXACTLY which version AND architecture of Java AND Windows we're dealing with. Also suspect is the last few lines of the log file:
       [INFO] :   Encrypting JavaScript files: C:\Users\LasComp\AppData\Roaming\Titanium\mobilesdk\win32\3.2.0.GA\android\titanium_prep.win32.exe "com.bd.test" "D:\Titanium\Titanium_Studio_Workspace\test\build\android\assets" "app.js" "ui/common/Array_table_ViewRow.js" "ui/common/cursorPosition.js" "ui/common/DataListView.js" "ui/common/facebook.js" "ui/common/facebook1.js" "ui/common/ListScrolView.js" "ui/common/ListView.js" "ui/common/List_textArea.js" "ui/common/ScrolAndScrolableView.js" "ui/common/ScrolView.js" "ui/common/ScrolViewAddImage.js" "ui/common/ScrolViewTable.js" "ui/common/Table.Row.js" "ui/common/TableView.js" "ui/common/Table_textArea.js" "ui/handheld/android/ApplicationWindow.js" "ui/handheld/android/cameraOpen.js" "ui/handheld/android/MediaSound.js" "ui/handheld/android/modalWindow.js" "ui/handheld/android/rowIndecator.js" "ui/handheld/android/ScrolableView.js" "ui/handheld/android/searchBar.js" "ui/handheld/android/View_ScrolView.js" "ui/handheld/android/XHRtest.js/XHR.js" "ui/handheld/ApplicationWindow.js" "ui/tablet/ApplicationWindow.js" "_app_props_.json"
       [INFO] :   Encrypting JavaScript files: C:\Users\LasComp\AppData\Roaming\Titanium\mobilesdk\win32\3.2.0.GA\android\titanium_prep.win64.exe "com.bd.test" "D:\Titanium\Titanium_Studio_Workspace\test\build\android\assets" "app.js" "ui/common/Array_table_ViewRow.js" "ui/common/cursorPosition.js" "ui/common/DataListView.js" "ui/common/facebook.js" "ui/common/facebook1.js" "ui/common/ListScrolView.js" "ui/common/ListView.js" "ui/common/List_textArea.js" "ui/common/ScrolAndScrolableView.js" "ui/common/ScrolView.js" "ui/common/ScrolViewAddImage.js" "ui/common/ScrolViewTable.js" "ui/common/Table.Row.js" "ui/common/TableView.js" "ui/common/Table_textArea.js" "ui/handheld/android/ApplicationWindow.js" "ui/handheld/android/cameraOpen.js" "ui/handheld/android/MediaSound.js" "ui/handheld/android/modalWindow.js" "ui/handheld/android/rowIndecator.js" "ui/handheld/android/ScrolableView.js" "ui/handheld/android/searchBar.js" "ui/handheld/android/View_ScrolView.js" "ui/handheld/android/XHRtest.js/XHR.js" "ui/handheld/ApplicationWindow.js" "ui/tablet/ApplicationWindow.js" "_app_props_.json"
       [DEBUG] :  32-bit titanium prep failed, trying again using 64-bit
       [ERROR] :  Failed to encrypt JavaScript files
       [ERROR] Application Installer abnormal process termination. Process exit value was 1
       
    It should say encrypting using the 32-bit version, then say 32-bit failed, trying 64-bit. In other words, the [DEBUG] 32-bit titanium prep failed, trying again using 64-bit should be printed out above the 64-bit call. Is Studio doing this?
  5. Ingo Muschenetz 2013-12-23

    [~vbullinger] Which version of 64-bit windows, and which version of Java?
  6. Vince Bullinger 2013-12-23

    Ingo Muschenetz Does the version matter? The JDK guide here http://docs.appcelerator.com/titanium/3.0/#!/guide/Installing_Oracle_JDK says to use 1.6. I have 1.7. Is this necessary? Is this my problem?
  7. Ingo Muschenetz 2013-12-23

    1.7 should actually work now. You could _try_ 1.6 to see if that helps.
  8. Vince Bullinger 2013-12-23

    Neither 1.6 or 1.7 worked. They gave me the exact same error message: [ERROR] : Failed to encrypt JavaScript files [ERROR] Application Installer abnormal process termination. Process exit value was 1 The 1.6 version was 32-bit, as the guide says to use. The 1.7 version was 64-bit.
  9. Ingo Muschenetz 2013-12-23

    Vince, you don't happen to have another machine around with a different version of Windows, do you? We're wondering if it's Windows 7.
  10. Vince Bullinger 2013-12-23

    I'll try on my personal machine instead of my work laptop. I can tell you that it works just fine on a Mac, though. I'll edit this when it's finished. EDIT: on my personal Windows 8 machine, I was able to get a brand new app to deploy to the emulator but not to my phone. I tried upgrading one app, but it won't deploy to either the emulator or my phone. But it says it failed to package the app, nothing about encrypting JavaScript files. The emulator acts like it's about to run, but it never does load up the app.
  11. Keylo E. 2013-12-23

  12. Kam 2013-12-24

    Same issue: [INFO] : Encrypting JavaScript files: [ERROR] : Failed to encrypt JavaScript files [ERROR] Application Installer abnormal process termination. Process exit value was 1
  13. Ingo Muschenetz 2013-12-24

    Hi All, We've had real trouble reproducing this. it must be something we're missing in a configuration. There are four variables:

    Version of Windows

    32 vs. 64-bit Windows

    32 vs. 64-bit version of Java

    Java 1.6 vs 1.7

    To make this scientific, when commenting on this ticket, please tell us the following

    Version of Windows

    Which line from the list below applies to you:

    Configurations:

    32-bit Windows, 32-bit Java, Java 1.6

    32-bit Windows, 32-bit Java, Java 1.7

    64-bit Windows, 32-bit Java, Java 1.6

    64-bit Windows, 64-bit Java, Java 1.6

    64-bit Windows, 32-bit Java, Java 1.7

    64-bit Windows, 64-bit Java, Java 1.7

    An example response might be: Windows 7, configuration #2 We'll use this to generate a matrix
  14. Daniel Lim C H 2013-12-24

    I am having the same issue with: Window 7 Professional SP1, configuration #4
  15. Ingo Muschenetz 2013-12-24

    One question to the group: If you create a brand-new Android project, does this happen as well? Or is it only with existing projects?
  16. Senad Biser 2013-12-24

    I'm not sure if my issue applies here.. I've updated Titanium yesterday and created new workspace and new project "TestApp" (Default Alloy App) Windows 8.1 Enterprise N, configuration #5 Titanium Studio Console Log when building from the "run on device" feature: [INFO] : Alloy compiler completed successfully [INFO] : Processing JavaScript files [INFO] : Encrypting JavaScript files: C:\Users\Senad\AppData\Roaming\Titanium\mobilesdk\win32\3.2.0.GA\android\titanium_prep.win32.exe "ba.genijalno.testapp" "C:\Users\Senad\repos\test\TestApp\build\android\assets" "app.js" "alloy/backbone.js" "alloy/CFG.js" "alloy/constants.js" "alloy/controllers/BaseController.js" "alloy/controllers/index.js" "alloy/styles/index.js" "alloy/sync/localStorage.js" "alloy/sync/properties.js" "alloy/sync/sql.js" "alloy/underscore.js" "alloy/widget.js" "alloy.js" "_app_props_.json" [INFO] : Encrypting JavaScript files: C:\Users\Senad\AppData\Roaming\Titanium\mobilesdk\win32\3.2.0.GA\android\titanium_prep.win64.exe "ba.genijalno.testapp" "C:\Users\Senad\repos\test\TestApp\build\android\assets" "app.js" "alloy/backbone.js" "alloy/CFG.js" "alloy/constants.js" "alloy/controllers/BaseController.js" "alloy/controllers/index.js" "alloy/styles/index.js" "alloy/sync/localStorage.js" "alloy/sync/properties.js" "alloy/sync/sql.js" "alloy/underscore.js" "alloy/widget.js" "alloy.js" "_app_props_.json" [ERROR] : Failed to encrypt JavaScript files [ERROR] Application Installer abnormal process termination. Process exit value was 1 These are the result when building from CLI (titanium build --platform android -T device): [INFO] Encrypting JavaScript files: C:\Users\Senad\AppData\Roaming\Titanium\mobilesdk\win32\3.2.0.GA\android\titanium_prep.win32.exe "ba.genijalno.testapp" "C:\Users\Senad\repo p.js" "alloy/backbone.js" "alloy/CFG.js" "alloy/constants.js" "alloy/controllers/BaseController.js" "alloy/controllers/index.js" "alloy/styles/index.js" "alloy/sync/localStorage ync/sql.js" "alloy/underscore.js" "alloy/widget.js" "alloy.js" "_app_props_.json" [DEBUG] 32-bit titanium prep failed, trying again using 64-bit [INFO] Encrypting JavaScript files: C:\Users\Senad\AppData\Roaming\Titanium\mobilesdk\win32\3.2.0.GA\android\titanium_prep.win64.exe "ba.genijalno.testapp" "C:\Users\Senad\repo p.js" "alloy/backbone.js" "alloy/CFG.js" "alloy/constants.js" "alloy/controllers/BaseController.js" "alloy/controllers/index.js" "alloy/styles/index.js" "alloy/sync/localStorage ync/sql.js" "alloy/underscore.js" "alloy/widget.js" "alloy.js" "_app_props_.json" [ERROR] Failed to encrypt JavaScript files [ERROR] Unable to locate a valid libjvm.dll. Thanks,
  17. Senad Biser 2013-12-24

    PS. The new TestApp and my other existing app deploy fine on the Android Emulator (Intel Atom x86, API 18, WVGA800) Thanks
  18. Sam Robertson 2013-12-24

    @Ingo: The same error exists for both new and old projects.
  19. anysome 2013-12-24

    same error. env: 64-bit Windows, 32-bit Java, Java 1.6
  20. Ingo Muschenetz 2013-12-24

    Hi All, If you _can_ create a new project and then deploy it to device, then you have a different error, or TIMOB-16077. Please follow along there. This ticket will be reserved for only those people who can't get a new project to compile. If you have an issue like "libjvm.dll can't be found", please try setting your java path on the command line:
        ti config java.home c:\path\to\jdk
        
    with the path being the root of the JDK directory. Then re-run your build.
  21. Senad Biser 2013-12-24

    Hi Ingo, TIMOB-16077 doesn't apply to me because I'm getting this error on a newly created project as well. I've tried setting the java.home via CLI to my 32b Java and I still got the same problem. However, once I've set the ti config java.home to my 64b Java I was able to deploy the new app and my existing app as well. Solution (for my case at least): - Windows 8.1 Enterprise N, config #5 (32b Java) doesn't compile/deploy for device - Windows 8.1 Enterprise N, config #6 (64b Java) compiles and deploys Thanks for the tip, maybe it helps someone else too!
  22. pingge 2013-12-25

    64-bit Windows ,32-bit or 64-bit java , 1.6 or 1.7
  23. Vladimir S 2013-12-25

    Hi Colleagues, I got the same issue, a simple workaround, to enable testing on device is to modify c:\Users\vladi\AppData\Roaming\Titanium\mobilesdk\win32\3.2.0.GA\android\cli\commands\_build.js line 905, and set encryptJS to false case 'test': this.minifyJS = true; >>>> this.encryptJS = false; this.allowDebugging = true; this.allowProfiling = true; this.includeAllTiModules = false; this.proguard = false;
  24. Ingo Muschenetz 2013-12-25

    A reminder:

    If you create a new project and run into this issue, this ticket (TIMOB-16073) is for you

    If you create a new project and it works, but an existing project fails, then your ticket is TIMOB-16077

    If you get the error "libjvm.dll can't be found" (or similar), try setting the path on the command line: 'ti config java.home c:\path\to\jdk'

  25. Kam 2013-12-26

    Hi Vladimir S, Thanks for your simple workaround. It is working for me now.
  26. Vince Bullinger 2013-12-26

    Following up: a new app won't work, an old app won't work. Won't work on Windows 8 or 7 - both 64-bit, with JDK 32-bit 1.6 or 64-bit 1.7. Mac works just fine. It's not my Mac, however. I'm going to go with Vladimir's work around. I'll demand a Mac of my own at work. I'm supremely disappointed in not only what's happened since the upgrade - which I had no clue would be major - but the response. All the responses are "HEY THIS IS SUPER IMPORTANT!!! WHAT'S YOUR OS, JDK, ETC?" and "GO TO THIS OTHER THREAD!" And no actual ideas whatsoever. Vladimir took it upon himself to give us a temporary workaround. I might try a complete uninstall, install and code port, which is ridiculous.
  27. Ingo Muschenetz 2013-12-26

    Vince, I am sorry that you have been unhappy with the response. Not only have we been unable to reproduce this yet ourselves, we don't yet understand which set of configurations reliably cause the issue. If you take three versions of Windows x 6 possible configurations, that gives at least 18 different versions of windows to try. Needless to say, we've had multiple people test on Windows 7, Windows 8 and 8.1, with 32 bit and 64-bit configurations, and using Java 1.6 and 1.7. No luck as of yet. There are multiple issues here, and my first job is to try and figure out who is having what. It can be challenging with a number of people all on the same ticket. My goal is the figure out who is experiencing what issue, which (if any) workarounds work, and make sure people know which ticket to watch depending on their symptoms. Modifying the SDK code is our last resort, and is only the most temporary of workarounds. I would be curious to know if 'ti config java.home c:\path\to\jdk' works for people.
  28. Vladimir S 2013-12-26

    Hi, i played a bit more with procmon, to see what the tool was searching for. Finally there is a REAL Solution :) The problems I found was 1. Missing "msvcr110.dll". Symptom - titanium fails with "Failed to encrypt JavaScript files", but does not mention libjvm.dll. Workaround: Install Visual C++ Redistributable for Visual Studio 2012 from - here http://www.microsoft.com/en-us/download/details.aspx?id=30679#. You can install 32 or 64 bit, depending on the JVM you are using (i installed both) 2. Incorrect JAVA_HOME - Symptom - Encryption fails with "Unable to locate a valid libjvm.dll.", Solution/Workaround? - seems like ti config java.home does not work - at least not in my environment, and at least not for titanium_prep.win*.exe. It searches the Environment Var JAVA_HOME. When i set it to the correct location it works. titanium_prep.win32.exe works if javA_home points to 32 bit jdk, and titanium_prep.win64.exe works if it points to 64 bit jvm. Titanium build tries both, so in case the java_home is correctly set - it works @Ingo - i hope this hints will help you to make it running in all environments. I also appreciate your efforts for solving this during the holidays :)
  29. Sam Robertson 2013-12-26

    @Ingo: I ran further testing and wanted to report my results: 1. Uninstalled Titanium Studio (The installer did not work, but that is another issue). 2. Removed all installations of Java on my system. 3. Installed Titanium Studio 3.2.0. The installer informed me that Java was needed and it would install it for me. 4. After Titanium Studio successfully installed, I tried deploying to several Android devices, and I received the same "encryption" error. 5. Looking at what was installed by the Titanium Studio installation, I see that Java SE Development Kit 7 Update 40 (32-bit) was installed in C:\Program Files (x86)\Java\jdk1.7.0_40 by the installer. That makes me now configuration # 5 from above. I commented out the encryption line per Vladimir S suggestion above, and I am now able to deploy to Android devices. Thanks Vladimir!!! I am able to continue with my development, and I will monitor this thread for the official fix. Thanks again all of you for working on this issue. Sam
  30. Vince Bullinger 2013-12-26

    Great job, Vladimir! I had looked at the source code myself, but saw several instances of "Failed to encrypt JavaScript files," so I decided not to go down that rabbit hole. But amazing job on your point for finding it and fleshing out a solution that worked for me. I wonder what piece of that install Appcelerator truly needs and what should be done about it as far as an update is concerned...
  31. Ingo Muschenetz 2013-12-26

    If you have the following symptoms:

    A new project fails with the encryption error (same as an existing project)

    Setting either your JAVA_HOME or java.home configuration variables don't work

    Please try downloading the .zip file attached to the ticket (titanium_prep-mt.zip) and unzipping it into: C:\path\to\Titanium\mobilesdk\win32\3.2.0.GA\android If you previously installed a separate runtime from Microsoft, see if you can uninstall that before testing out this new version to make sure that we've actually addressed the issue.
  32. Daniel Lim C H 2013-12-27

    @Ingo, thank you for ur effort and fast respond on this ticket. I am able to run on device successfully after i replace the file according to the instruction.
  33. Manuel Conde Vendrell 2013-12-27

    Same for me, thanks. Seems to be solved with that (titanium_prep-mt.zip).
  34. Allen Yeung 2013-12-27

    PR to update this on master: https://github.com/appcelerator/titanium_mobile/pull/5167 3_2_X: https://github.com/appcelerator/titanium_mobile/pull/5168
  35. Priya Agarwal 2014-01-07

    Issue seems to be fixed Tested with environment: Appc-Studio: 3.2.1.201401061716 acs:1.0.11 alloy:1.3.1-beta npm:1.3.2 titanium:3.2.0 titanium-code-processor:1.1.0 Osx: Windows 8 Device:Galaxy Note(v2.3.6) using both sdk build:3.2.1.v20140106195644 and 3.3.0.v20140106195650 Tried with both classic and alloy default project and was able to build and deploy successfully on the device.
  36. Lokesh Choudhary 2014-01-10

    Verified the fix. We do not see any failures related to javascript & the alloy/classic app builds & runs fine on device. Closing. Environment: Appc Studio : 3.2.1.201401081616 Titanium studio : 3.2.1.201401081514 Ti SDK : 3.2.1.v20140109163246 , 3.3.0.v20140110133250 Windows 7 ,8 & 8.1 (32-bit & 64-bit) Java : 1.6.0_45 & 1.7.0_45 (32-bit & 64-bit where ever applicable) Alloy : 1.3.1-beta2 CLI - 3.2.1-beta Samsung Galaxy S4 running android 4.2.2
  37. carlo 2014-06-23

    I got the same error, in my case the problem was a file with a very long line (100.000+ columuns)

JSON Source