Closed gvsakhil closed 5 years ago
@gvsakhil,
NativeScript 6.0 release has breaking changes that affects the way the hooks are executed. More info can be found here.
As platformsData
is renamed to platformsDataService
in CLI 6.0, you need to change $platformsData
to $platformsDataService
:
module.exports = function($platformsDataService) {
If you want to make it backwards compatible, you could use the following:
module.exports = function($injector, hookArgs) {
const platformsData = getPlatformsData($injector);
}
function getPlatformsData($injector) {
try {
return $injector.resolve("platformsData");
} catch (err) {
return $injector.resolve("platformsDataService");
}
}
I'm closing this issue as it is expected after migrating to NativeScript 6.0.
In which file should I make that change module.exports = function($platformsDataService) { @Fatme
@gvsakhil,
The change should be made in /Users/akki/Documents/Workspace/UTU/UTU.MobileApp/hooks/before-prepare/nativescript-custom-entitlements.js
.
Sometimes we delete hooks folder and again build. So we should change the code every time we delete hooks folder?
Environment Provide version numbers for the following components (information can be retrieved by running
tns info
in your project folder or by inspecting thepackage.json
of the project):Describe the bug When I run tns run android Its giving a warning /Users/akki/Documents/Workspace/UTU/UTU.MobileApp/hooks/before-prepare/nativescript-custom-entitlements.js will NOT be executed because it has invalid arguments - platformsData. and this is happening from the day I migrated my nativescript version to tns6.