Skip to content

Conversation

@rosen-vladimirov
Copy link
Contributor

When trying to run application on iOS in Sidekick for the first time (when the iOS platform is not added yet to the project), the run fails with error "Cannot read property version of undefined".
The problem is in the call to platformLiveSyncService.prepareForLiveSync which tries to start parsing device logs before starting the liveSync action. However, at this point, the application does not have the platform added yet and the code that tries to get the version of tns-ios from project's package.json fails. In order to resolve this, ensure the code for getting framework version from package.json will return undefined instead of failing.
When undefined is returned, we know CLI will add the latest compatible iOS runtime version. We know that this version will print the port for debugging in the logs, so we can safely start parsing the logs.

PR Checklist

When trying to run application on iOS in Sidekick for the first time (when the iOS platform is not added yet to the project), the run fails with error "Cannot read property version of undefined".
The problem is in the call to `platformLiveSyncService.prepareForLiveSync` which tries to start parsing device logs before starting the liveSync action. However, at this point, the application does not have the platform added yet and the code that tries to get the version of `tns-ios` from project's package.json fails. In order to resolve this, ensure the code for getting framework version from package.json will return undefined instead of failing.
When undefined is returned, we know CLI will add the latest compatible iOS runtime version. We know that this version will print the port for debugging in the logs, so we can safely start parsing the logs.
@rosen-vladimirov rosen-vladimirov added this to the 4.1.1 milestone Jun 15, 2018
@rosen-vladimirov rosen-vladimirov self-assigned this Jun 15, 2018
@Natalia-Hristova
Copy link

run ci

2 similar comments
@Natalia-Hristova
Copy link

run ci

@Natalia-Hristova
Copy link

run ci

@rosen-vladimirov rosen-vladimirov merged commit aaa980c into release Jun 15, 2018
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/fix-run-ios-sk branch June 15, 2018 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants