Titanium JIRA Archive
Appcelerator Community (AC)

[AC-6453] Compilation broken with "app.js not found" error

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsAppcelerator CLI, Titanium SDK & CLI
Labelsandroid, ios
ReporterSimon Buckingham
AssigneeAminul Islam
Created2019-12-06T12:41:08.000+0000
Updated2019-12-20T16:04:49.000+0000

Description

Compilation is broken resulting in an "app.js not found error" for iOS and Android: [ERROR] "app.js" not found [ERROR] Ensure the "app.js" file exists in your project's "Resources" directory. This is when running for example: $appc ti build -p ios --target simulator --device-id 8691784A-146E-4125-9CC4-255885FF9195 Or $appc ti build -p android --target emulator --device-id 'Samsung Galaxy S9 - 8.0' (The same thing happens using just $ti build....) appc version = 7.1.2 Ti SDK = 8.3.0 Xcode = 10.2.1 OS X 10.14.6 It seems to be related to some weird caching that is going on during compilation. I don't know what is cached or how it works exactly. It started to happen randomly, probably between switching between git branches. One minute working fine then next not. So some odd things. Quitting the terminal window and opening a new one it started working once and then stopped working again. Another weird thing I discovered is that creating a new project in a completely different directory - with just the default template app created with $appc new - but with the same project name and id - the compile was still broken with the same "app.js not found error". So even though this was a completely fresh app in a completely different directory, as it had the same id as the previously broken app, it still thought it was compiling the old app. Obviously some caching going on here. Long story short I created a completely new fresh project and then copied over the stuff I needed into that project and this worked. But the "ti build" process is broken somehow and this is an impractical solution for something which keeps happening regularly now. I spoke to @ewanharris Ewan Harris on Ti Slack and he suggested it might be a caching problem with XCode and to try to clear out ~/Library/Developer/Xcode/DerivedData but obviously this is only for iOS and not Android (this did not solve the problem). Each time I compile I ensure that the build folder and Resources folder are cleared. I have seen this "app.js not found error" been reported previously with people who are trying to compile directly with XCode, but I am not doing that and am only using appc ti build and as I said same problem with Android.

Comments

  1. Simon Buckingham 2019-12-06

    I think this may be due to the disappearance of alloy.js in plugins > ti.alloy > hooks. No idea why this file disppears (I have taken over a 5 year old project so no idea how it was built).
  2. Aminul Islam 2019-12-20

    Hello! Thanks for reaching out! What does *appc ti setup check* tell you about setup? Please share full setup check log with with us. Also try following steps: 1. Create a new project (appc new -t app --id -n ) 2. Replace only App folder with your old app folder. 3. Now build your project with [CLI | http://docs.appcelerator.com/platform/latest/#!/guide/Appcelerator_CLI_Tasks-section-src-43306725_AppceleratorCLITasks-AndroidEmulator ] If this won't help set console log level to trace and share full error log. Regards, Aminul Islam

JSON Source