Even i got the same error when i tried to add a platform to the ionic application. Its not just the problem with phone gap. It is also a headache while adding platforms in an ionic application. I was searching for the solution and finally, i landed at this page. Based on Luke Snowden
answer i tried to find the solution. But in ionic app, there won't be any folder with the name before_build
. And the solution is just changing the mode of files present in the hooks
folder. The permissions should have +x
i.e. execute permissions.
Go to hooks folder, you may find the following two folders
1) after_prepare
2) before_platform_add
Change the permissions of two folders to +x
chmod -x <folder name>
You can even change individual file's permission also.
Go to the respected folder and say
chmod -x <file name>
for each file to change the mode to +x
.
After you are done with the above process, now we can add platforms to the application.
ionic platform add android
Now it wont show any errors on the console.
Hope this might help people who are facing the similar kind of problem.