Recovery from a big mistake

Hi.
I’ve made a huge mistake. My application was working perfectly with the “ionic serve”. I tested before on my phone. Everything ok. I published the application and tried to install it. It just showed up an alert saying that the application stopped. I tried to run the application using “ionic run android” and had the same error. Running on the device by visual studio 2013 worked right.
seeking a way out, I found similar problem and a solution that was “Cordova platform removes android” and “Cordova platform add android” This was the big mistake. Everything had gone into platforms / android (including the program’s certificate) and now when I try to run the application, it works but I only get a blank screen. When I run it with the “ionic serve” still working normal.
What can I do?

Ah. The folder Ant-Build is missing from android platform after the “cordova platform add android”

There are probably a billion combinations of problems that it could be. I would suggest doing some research on how to get your debug logs on android and see if it’s a specific call, maybe a variable, something that is going wrong on the android phone.

When you are using Ionic serve, the cordova library is not loaded because it’s not running on a device. When you run on a device, cordova is loaded up and will load all the plugins and native code. That is most likely where the error is coming from

Ok. But when I run the application from Visual Studio, on the device, the application runs ok. It loads the ionic library, right?

That’s all we can assume but like I said your logs are your best friends. They can tell you what’s going on better than I can since I can’t see them. If you try posting some of the log we can go through it and see if anything looks out of the ordinary.

Ok. I got the problem. I have an state like this:

$stateProvider
        .state('start', {
        	abstract: true,
        	url: '/start',
        	templateUrl: 'app/home/start.html'
        })

        .state('start.login', {
        	url: '/login',
        	views: {
        		'startContent': {
        			templateUrl: 'app/home/login.html',
        			controller: 'LoginCtrl'
        		}
        	}
        })
        .state('start.cadastro', {
        	url: '/cadastro',
        	views: {
        		'startContent': {
        			templateUrl: 'app/home/cadastro.html',
        			controller: 'CadastroCtrl'
        		}
        	}
        })

and in CadastroCtrl I have a

$state.go('start.login')

but, following the code flow, the state becomes undefined in some point inside the ionic.bundle and the login.html page is not reached.

any ideas?

thx in advanced

another consideration on the same problem.
this is a ion-content from one view

<div class="item item-text-wrap" ng-style="itemNormal" ng-repeat="order in orders">
            <div class="row" ng-style="itemWhite">
                <div class="col col-20" ng-style="buttonDeleted" ng-click="removeOrder(order); $stopPropagation();"><i class="icon ion-minus-circled"></i></div>
                <div class="col col-80" ng-style="longName" >{{order.Item.dsc_item_empresa}}</div>
            </div>
			<div class="row" ng-style="itemWhite">
				<div class="col col-10" ng-style="buttonClip" ng-click="addObs($index); $stopPropagation();"><i class="icon ion-clipboard"></i></div>
				<div class="col col-50" ng-style="longName" >{{order.Item.Observacao}}</div>
				<div class="col col-15">{{order.Quantidade}} x </div>
				<div class="col col-25" ng-style="itemPrice">{{order.Item.preco_venda | currency}}</div>
			</div>
        </div>

after the problem, the removeOrder() event is firing, the addObs() is not.

Ok. to close this.
I start a new project and now everything is ok.

thx