Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28226] Liveview: Build errors if project directory path contains Resources

GitHub Issuen/a
TypeBug
PriorityNone
StatusIn Review
ResolutionUnresolved
Affected Version/sRelease 9.3.0, Release 9.2.2
Fix Version/sn/a
ComponentsLiveView
Labelsn/a
ReporterEwan Harris
AssigneeEwan Harris
Created2020-11-04T10:40:55.000+0000
Updated2020-11-04T14:43:54.000+0000

Description

Description

If a project directory path contains Resources anywhere in the path (e.g. /Users/ewan/Resources/my-titanium-app/) then liveview will error out with Project directory "<project directory parent>" is not a valid Titanium project (e.g. Project directory "/Users/ewan/Resources/" is not a valid Titanium project This is because liveview is performing a bad lookup on whether the provided project directory contains Resources or not, and then popping off the last segment of the path regardless of where Resources is found

Steps to reproduce

1. Create a project called Resources 2. cd into that directory and create a new titanium app 3. Build the project with liveview enabled

Actual

Liveview complains that the parent directory is not a titanium project

Expected

Liveview should function just fine

Comments

  1. Ewan Harris 2020-11-04

    PR: https://github.com/appcelerator/liveview/pull/205 To apply this fix before it ships: 1. Open ~/Library/Application Support/Titanium/mobilesdk/<OS>/<SDK>/node_modules/liveview/lib/fserver.js where OS is one of osx, linux, or win32 and SDK is the SDK version you want to apply the fix to 2. Look for RESOURCE_DIR = (!~RESOURCE_DIR.indexOf('Resources')) ? RESOURCE_DIR + '/Resources' : RESOURCE_DIR; (should be line 165) and replace with the below
       if (path.basename(RESOURCE_DIR) !== 'Resources') {
       	RESOURCE_DIR = path.join(RESOURCE_DIR, 'Resources');
       }
       

JSON Source