Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27882] Android: Unable to do a production build after switching SDK on Windows

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2020-08-14T18:03:13.000+0000
Affected Version/sRelease 9.0.1
Fix Version/sRelease 9.1.0
ComponentsAndroid
Labelsandroid, build, gradle
ReporterSamir Mohammed
AssigneeJoshua Quick
Created2020-05-06T15:01:33.000+0000
Updated2020-08-14T18:03:13.000+0000

Description

When creating a production build with two different SDKs the following error can be seen:
[ERROR] :  Error: EBUSY: resource busy or locked, unlink 'C:\Users\APPC\Documents\Appcelerator_Studio_Workspace\elloello\build\android\app\build\intermediates\metadata_library_dependencies_report\release\dependencies.pb'
*Note*: If you manually end the java-tm process you are able to build *Test Steps:*

Open Appcelerator studio

Create a new alloy application using SDK: 9.0.2.v20200505111803

Package using the Android store option in the drop down menu

Go through the prompts and select an output destination

Wait for .APK and .AAB to be created

Change SDK in the tiapp.xml to SDK: 9.1.0.v20200505112143

Package again using the Android store option in the drop down menu

Go through the prompts and select an output destination

Comments

  1. Joshua Quick 2020-05-06

    [~smohammed], would you mind trying something out for me please? (I don't have access to a Windows machine right now.) Please do this:

    Do a "production" build with 9.0.2.

    Open the Windows Command Prompt.

    CD to directory: <YourProject>/build/android

    Enter: gradlew :app:clean

    Do a "production" build with 9.1.0.

    The above checks to see if telling the gradle tools to clean the build folder will release the file lock for us. Thanks!
  2. Samir Mohammed 2020-05-07

    [~jquick] Following those steps I was able to do a production build without any issues. Console showed this output when doing: gradlew :app:clean
       Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.lean
       Use '--warning-mode all' to show the individual deprecation warnings.
       See https://docs.gradle.org/6.3/userguide/command_line_interface.html#sec:command_line_warnings
       
       BUILD SUCCESSFUL in 1s
       1 actionable task: 1 executed
       
    If I tried doing gradlew :app:clean after a failed production build (as mentioned in the ticket description) console would show this message:
       'gradlew' is not recognized as an internal or external command
       
  3. Samir Mohammed 2020-05-18

    Error is also seen when running a Hyperloop application. (In this instance first ran on a Sim and then a device straight after where the below error was seen)
       [ERROR] :  Error: EBUSY: resource busy or locked, unlink 'C:\Users\APPC\Documents\Appcelerator_Studio_Workspace\aaaaanewapp\build\hyperloop\android\gradle\wrapper\gradle-wrapper.jar'
       [ERROR] Application Installer abnormal process termination. Process exit value was 1
       
  4. Joshua Quick 2020-05-19

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/11712 _*Edit:*_ _The below PRs have been closed and are not needed._ -PR (hyperloop):- https://github.com/appcelerator/hyperloop.next/pull/338 -PR (9.0.x):- https://github.com/appcelerator/titanium_mobile/pull/11713
  5. Joshua Quick 2020-05-19

    [~smohammed], theoretically, cleaning a module via appc ti clean should have a file locking issue on Windows too. Since I don't have a Windows machine available to me, I'm not able to confirm this. So, I added a "Module Clean Test" to my PR posted above.
  6. Srinivasan Pulipakkam 2020-05-21

    Moving to Open Status
  7. Christopher Williams 2020-06-17

    merged to master for 9.1.0 target
  8. Samir Mohammed 2020-08-14

    Closing ticket, Fix verified in SDK Version 9.1.0.v20200814072027 Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/11712

JSON Source