by Mohammed Essaid MEZERREG.
No problems, I was able to solve this problem.
We used Phonegap at the beginning then we wanted to use ionic.io package and ionic view to test the app very quickly in different devices, that when we switched to cli.
For the problem of building, I installed all the extra tools for android sdk, then I explicitly mentioned the version of cordova android in the package.json file and set it to 5.0.0, And I downgraded the cordova version to 5.2.x to avoid any problems in building for previous version using the new one. Then I clean everything, reset the ionic/cordova plugins and platforms using ionic state reset command, build it, test it and it works fine in ionic view in ionic package, using ionic emulate or run. Everything is perfect.