Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28423] Android: Windows - Unable to launch application on 2nd run without cleaning

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2021-04-21T16:42:33.000+0000
Affected Version/sRelease 10.0.0
Fix Version/sRelease 10.0.0
ComponentsAndroid
Labelsn/a
ReporterSamir Mohammed
AssigneeGary Mathews
Created2021-04-16T15:29:28.000+0000
Updated2021-04-21T16:42:33.000+0000

Description

When running an application more then once without cleaning the following error is shown, when using appc studio. *Error:*
[ERROR] :  Error: EBUSY: resource busy or locked, copyfile 'C:\Users\APPC\Documents\Appcelerator_Studio_Workspace\aa2\Resources\android\images\res-notlong-land-ldpi\default.png' -> 'C:\Users\APPC\Documents\Appcelerator_Studio_Workspace\aa2\build\android\app\src\main\res\drawable\background.png'
[ERROR] Application Installer abnormal process termination. Process exit value was 1
*Test Steps:*

Open Appc Studio

Create a new Alloy application

Run Application

Wait for application to boot up on the emulator

Stop build

Run the alloy application again

*Actual Result* Above error is shown *Expected result* Application should launch without issues *Note** If a clean is done then application runs without issues even on subsequent builds.

Attachments

FileDateSize
logsfff.txt2021-04-16T15:28:50.000+000043232

Comments

  1. Joshua Quick 2021-04-16

    From looking at the debug log entries, the real issue appears to be "default.png" files from different density folders are all being copied to the same destination folder. I'm not seeing this on Mac.
  2. Samir Mohammed 2021-04-20

    FR passed, waiting on Jenkins build.
  3. Christopher Williams 2021-04-20

    merged to master and 10_0_X branches.
  4. Samir Mohammed 2021-04-20

    [~gmathews] Looks like this ticket may have caused issues when installing to device.
       ERROR] :  [GRADLE] C:\Users\APPC\Documents\Appcelerator_Studio_Workspace\anewapp\build\android\app\src\main\java\com\appc\anewapplolo\AssetCryptImpl.java:37: error: illegal escape character
       [INFO] :   [GRADLE] > Task :app:compileDebugJavaWithJavac FAILED
       [ERROR] :  [GRADLE]             "Resources/alloy\CFG.js",
       [ERROR] :  [GRADLE]                              ^
       [ERROR] :  [GRADLE] C:\Users\APPC\Documents\Appcelerator_Studio_Workspace\anewapp\build\android\app\src\main\java\com\appc\anewapplolo\AssetCryptImpl.java:41: error: illegal escape character
       [ERROR] :  [GRADLE]             "Resources/alloy\constants.js",
       [ERROR] :  [GRADLE]                              ^
       [ERROR] :  [GRADLE] C:\Users\APPC\Documents\Appcelerator_Studio_Workspace\anewapp\build\android\app\src\main\java\com\appc\anewapplolo\AssetCryptImpl.java:42: error: illegal unicode escape
       [ERROR] :  [GRADLE]             "Resources/alloy\underscore.js",
       [ERROR] :  [GRADLE]                               ^
       [ERROR] :  [GRADLE] C:\Users\APPC\Documents\Appcelerator_Studio_Workspace\anewapp\build\android\app\src\main\java\com\appc\anewapplolo\AssetCryptImpl.java:43: error: illegal escape character
       [ERROR] :  [GRADLE]             "Resources/alloy\widget.js",
       [ERROR] :  [GRADLE]                              ^
       [ERROR] :  [GRADLE] C:\Users\APPC\Documents\Appcelerator_Studio_Workspace\anewapp\build\android\app\src\main\java\com\appc\anewapplolo\AssetCryptImpl.java:44: error: illegal escape character
       [ERROR] :  [GRADLE]             "Resources/alloy\styles\index.js",
       [ERROR] :  [GRADLE]                              ^
       [ERROR] :  [GRADLE] C:\Users\APPC\Documents\Appcelerator_Studio_Workspace\anewapp\build\android\app\src\main\java\com\appc\anewapplolo\AssetCryptImpl.java:44: error: illegal escape character
       [ERROR] :  [GRADLE]             "Resources/alloy\styles\index.js",
       [ERROR] :  [GRADLE]                                     ^
       [ERROR] :  [GRADLE] C:\Users\APPC\Documents\Appcelerator_Studio_Workspace\anewapp\build\android\app\src\main\java\com\appc\anewapplolo\AssetCryptImpl.java:45: error: illegal escape character
       [ERROR] :  [GRADLE]             "Resources/alloy\sync\localStorage.js",
       [ERROR] :  [GRADLE]                              ^
       [ERROR] :  [GRADLE] C:\Users\APPC\Documents\Appcelerator_Studio_Workspace\anewapp\build\android\app\src\main\java\com\appc\anewapplolo\AssetCryptImpl.java:45: error: illegal escape character
       [ERROR] :  [GRADLE]             "Resources/alloy\sync\localStorage.js",
       [ERROR] :  [GRADLE]                                   ^
       [ERROR] :  [GRADLE] C:\Users\APPC\Documents\Appcelerator_Studio_Workspace\anewapp\build\android\app\src\main\java\com\appc\anewapplolo\AssetCryptImpl.java:46: error: illegal escape character
       [ERROR] :  [GRADLE]             "Resources/alloy\sync\properties.js",
       [ERROR] :  [GRADLE]                              ^
       [ERROR] :  [GRADLE] C:\Users\APPC\Documents\Appcelerator_Studio_Workspace\anewapp\build\android\app\src\main\java\com\appc\anewapplolo\AssetCryptImpl.java:46: error: illegal escape character
       [ERROR] :  [GRADLE]             "Resources/alloy\sync\properties.js",
       [ERROR] :  [GRADLE]                                   ^
       [ERROR] :  [GRADLE] C:\Users\APPC\Documents\Appcelerator_Studio_Workspace\anewapp\build\android\app\src\main\java\com\appc\anewapplolo\AssetCryptImpl.java:47: error: illegal escape character
       [ERROR] :  [GRADLE]             "Resources/alloy\sync\sql.js",
       [ERROR] :  [GRADLE]                              ^
       [ERROR] :  [GRADLE] C:\Users\APPC\Documents\Appcelerator_Studio_Workspace\anewapp\build\android\app\src\main\java\com\appc\anewapplolo\AssetCryptImpl.java:47: error: illegal escape character
       [ERROR] :  [GRADLE]             "Resources/alloy\sync\sql.js",
       [ERROR] :  [GRADLE]                                   ^
       [ERROR] :  [GRADLE] C:\Users\APPC\Documents\Appcelerator_Studio_Workspace\anewapp\build\android\app\src\main\java\com\appc\anewapplolo\AssetCryptImpl.java:48: error: illegal escape character
       [ERROR] :  [GRADLE]             "Resources/alloy\controllers\BaseController.js",
       [ERROR] :  [GRADLE]                              ^
       [ERROR] :  [GRADLE] C:\Users\APPC\Documents\Appcelerator_Studio_Workspace\anewapp\build\android\app\src\main\java\com\appc\anewapplolo\AssetCryptImpl.java:48: error: illegal escape character
       [ERROR] :  [GRADLE]             "Resources/alloy\controllers\BaseController.js",
       [ERROR] :  [GRADLE]                                          ^
       [ERROR] :  [GRADLE] C:\Users\APPC\Documents\Appcelerator_Studio_Workspace\anewapp\build\android\app\src\main\java\com\appc\anewapplolo\AssetCryptImpl.java:49: error: illegal escape character
       [ERROR] :  [GRADLE]             "Resources/alloy\controllers\index.js",
       [ERROR] :  [GRADLE]                              ^
       [ERROR] :  [GRADLE] C:\Users\APPC\Documents\Appcelerator_Studio_Workspace\anewapp\build\android\app\src\main\java\com\appc\anewapplolo\AssetCryptImpl.java:49: error: illegal escape character
       [ERROR] :  [GRADLE]             "Resources/alloy\controllers\index.js",
       [ERROR] :  [GRADLE]                                          ^
       [ERROR] :  [GRADLE] 16 errors
       [ERROR] :  [GRADLE]
       [INFO] :   [GRADLE] 23 actionable tasks: 23 executed
       [ERROR] :  [GRADLE] FAILURE: Build failed with an exception.
       [ERROR] :  [GRADLE]
       [ERROR] :  [GRADLE] * What went wrong:
       [ERROR] :  [GRADLE] Execution failed for task ':app:compileDebugJavaWithJavac'.
       [ERROR] :  [GRADLE] > Compilation failed; see the compiler error output for details.
       [ERROR] :  [GRADLE]
       [ERROR] :  [GRADLE] * Try:
       [ERROR] :  [GRADLE] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
       [ERROR] :  [GRADLE]
       [ERROR] :  [GRADLE] * Get more help at https://help.gradle.org
       [ERROR] :  [GRADLE]
       [ERROR] :  [GRADLE] BUILD FAILED in 6s
       [ERROR] :  "gradlew" tool returned exit code: 1
       [ERROR] Application Installer abnormal process termination. Process exit value was 1
       
  5. Joshua Quick 2021-04-20

    [~gmathews], It's an issue with our AssetCryptImpl.java file here... https://github.com/appcelerator/titanium_mobile/blob/master/android/templates/build/AssetCryptImpl.java#L38 We need to change the template's line from this...
       "Resources/<%- assets[i] %>",
       
    ...to this...
       "Resources/<%- assets[i].replace(/\\/g, '/') %>",
       
    We will need to test encrypted/device builds made on Windows to make sure the app's JS requires/imports work. The above will turn the back slashes '\' to forward slashes '/' which is needed in order for the app to find JS files under subdirectories We should also enable a "trace" log to see if the backslashes will cause any logging issues to the console. (We might already be okay, but it doesn't hurt to double check this.)
  6. Gary Mathews 2021-04-20

    master: https://github.com/appcelerator/titanium_mobile/pull/12733
  7. Samir Mohammed 2021-04-21

    FR Passed, waiting on Jenkins build and backports.

JSON Source