當我通過USB連接它並且正在調試時,我的離子應用程序在瀏覽器中運行良好,並在我的Android手機上運行良好。Ionic因爲轉換錯誤而無法在Android上運行
但是當我建立一個新的.apk文件並在手機上安裝那個(通過電子郵件)時,什麼也沒有發生。看看我安裝並啓用了VorlonJs。
感謝沃龍,我可以看到發生了什麼。在Vorlon(讀取我的Android手機的控制檯日誌)的控制檯日誌,我可以看到這條消息
t r a n s i t i o n f a i l e d
t r a n s i t i o n a b o r t e d
t r a n s i t i o n p r e v e n t e d
t r a n s i t i o n s u p e r s e d e d
我怎樣才能解決這個問題,也許有人知道如何禁用所以至少我的應用程序工作的過渡?
編輯
我創建了一個空白的項目,此路由:
.config(function ($stateProvider, $urlRouterProvider) {
$stateProvider
.state('login', {
url: '/login',
templateUrl: 'account/login.html',
controller: 'AccountController',
})
.state('register', {
url: '/register',
templateUrl: '/account/register.html',
controller: 'AccountController',
});
$urlRouterProvider.otherwise('/login');
})
而這也給了同樣的問題。當我運行這個新的空白應用程序時,我無法從'登錄'進入'註冊'。在鉻和調試模式(ionic run android --device -c -l
)一切工作正常。
對於這裏的完整性是我的所有代碼:
app.js
var app = angular.module('starter', ['ionic','ionic.service.core']);
app
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if(window.StatusBar) {
StatusBar.styleDefault();
}
Ionic.io();
var push = new Ionic.Push({});
push.register(function(token) {
// Log out your device token (Save this!)
console.log("Got Token:",token.token);
});
});
})
.config(function ($stateProvider, $urlRouterProvider) {
$stateProvider
/*.state('account', {
abstract: true,
url: '/account',
template: '<ion-nav-view></ion-nav-view>'
})*/
.state('login', {
url: '/login',
templateUrl: 'account/login.html',
controller: 'AccountController',
})
.state('register', {
url: '/register',
templateUrl: '/account/register.html',
controller: 'AccountController',
});
$urlRouterProvider.otherwise('/login');
})
的index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<script src="lib/ionic-platform-web-client/dist/ionic.io.bundle.min.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<!-- Cordova is bootstrapped by ionic-platform-web-client, uncomment this if you remove ionic-platform-web-client... -->
<!-- <script src="cordova.js"></script> -->
<script src="http://recipeapi.demaffia.nl:1337/vorlon.js"></script>
<!-- your app's js -->
<script src="js/app.js"></script>
<script src="js/UrlService.js"></script>
<script src="account/AccountService.js"></script>
<script src="account/AccountController.js"></script>
<script src="js/storage/localstorage.js"></script>
</head>
<body ng-app="starter">
<ion-pane>
<ion-header-bar class="bar-stable">
<h1 class="title">Ionic Blank Starter</h1>
</ion-header-bar>
<ion-content>
</ion-content>
<ion-nav-view></ion-nav-view>
</ion-pane>
</body>
</html>
帳戶/ login.html的
<ion-view title="Inloggen">
<ion-content padding="true">
<form name="form.login" data-ng-submit="vm.login()">
<ion-list>
<ion-item>
<span class="input-label">Emailadres</span>
<input type="text" class="full-width" placeholder="Emailadres" data-ng-model="login.Email" required="required">
</ion-item>
<ion-item>
<span class="input-label">Wachtwoord</span>
<input type="password" class="full-width" placeholder="Wachtwoord" data-ng-model="login.Password" required="required">
</ion-item>
</ion-list>
<input type="submit" class="button button-block button-positive" value="Login" ng-disabled="!form.login.$valid" />
<a ui-sref="register" class="button button-block button-balanced">Registreren</a>
</form>
</ion-content>
</ion-view>
account/register.html
條<ion-view title="Registreren">
<ion-content padding="true">
<form name="form.register" data-ng-submit="vm.register()">
<ion-list>
<ion-item>
<span class="input-label">Naam</span>
<input type="text" class="full-width" placeholder="Naam" data-ng-model="login.Name" required="required">
</ion-item>
<ion-item>
<span class="input-label">Emailadres</span>
<input type="text" class="full-width" placeholder="Emailadres" data-ng-model="login.Email" required="required">
</ion-item>
<ion-item>
<span class="input-label">Wachtwoord</span>
<input type="password" class="full-width" placeholder="Wachtwoord" data-ng-model="login.Password" required="required">
</ion-item>
</ion-list>
<input type="submit" class="button button-block button-positive" value="Registreer" ng-disabled="!form.register.$valid" />
</form>
</ion-content>
</ion-view>
這總是很難調試。您可以嘗試通過'ionic run --device'安裝應用程序,並通過'adb install'和電子郵件安裝相同的內置APK。 –
@KateMihalikova感謝您的建議,但它仍然無法正常工作。我認爲這與路由有關。我創建了一個新的空白項目,其中只有2個狀態,我無法從狀態1轉換到狀態2.請參閱我的更新後的帖子。 – Martijn
進行調試apk並在此處放置一個鏈接。 –