[TIMOB-23864] CLI: Build process does not exit if using an incompatible module based on apiversion
GitHub Issue | n/a |
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-09-19T17:12:02.000+0000 |
Affected Version/s | Release 6.0.0 |
Fix Version/s | Release 6.0.0, node-appc 0.2.37 |
Components | Android, CLI, Tooling |
Labels | qe-6.0.0 |
Reporter | Ewan Harris |
Assignee | Feon Sua Xin Miao |
Created | 2016-09-05T10:02:09.000+0000 |
Updated | 2016-09-19T18:33:20.000+0000 |
Description
Description
When building using a 6.0.0 SDK and an old module that is incompatible with this SDK i.e the apiversion of the module is 2 the build process will not error out on the module check and the app will build and attempt to launch on device, but will not open.
*Notes*
The inverse of the situation does not happen as the CLI only enforces the minsdk value from the manifest and not the apiversion
Steps to reproduce
*These steps assume you have the same versions on your machine, correct as needed*
Edit the tiapp.xml modules section to include the following <module platform="android" version="2.3.10">ti.map</module>
Include ti.map in your project by adding var map = require('ti.map')
Ensure you are building with a 6.0.0 SDK
Build the project using appc run -p android -T device
Actual result
The project will build successfully, the app will attempt to launch on device but fail
Expected result
As the module is incompatible with 6.0.0, the build process should fail
Comments
JSON Source
node-appc PR: https://github.com/appcelerator/node-appc/pull/118
Master: https://github.com/appcelerator/titanium_mobile/pull/8325 6_0_X: https://github.com/appcelerator/titanium_mobile/pull/8324
[~fmiao], I get the debug log
if an incompatible module is used. But should we use more vocal log like warn/error. Also, I get this error, Not sure where this comes from:
This defeats the purpose of showing the debug log. Full log:
So, all that we need to do is edit
builder.js
and invalidateTiModules()
, add theapi-version
to the error output. First we need to do:Then add the following to the missing and incompatible module list
console.log()
calls:The error output is from [modules.missing.length](https://github.com/appcelerator/titanium_mobile/blob/master/node_modules/titanium-sdk/lib/builder.js#L355), although under this case it should go into [modules.incompatible.length](https://github.com/appcelerator/titanium_mobile/blob/master/node_modules/titanium-sdk/lib/builder.js#L364).
[~fmiao] You did put it under incompatible modules. :) https://github.com/appcelerator/node-appc/blob/dfd8dc5cab6f4978c9d4d5da85a8fd1b9ef1a79a/lib/timodule.js#L304
Fixed node-appc@0.2.38. Build should fail with following message:
Verified the fix. Closing. Environment: Appc Studio : 4.8.0.201609101003 Ti SDK : 6.0.0.v20160919100523 Ti CLI : 5.0.9 Alloy : 1.9.1 MAC El Capitan : 10.11.6 Appc NPM : 4.2.8-6 Appc CLI : 6.0.0-46 Node: 4.4.4 Nexus 6 - Android 6.0.1