Android 4.4 first launch error


#1

Hi!

I’m using Ionic with RequireJS and ngCordova. For some reason on Android 4.4.2 when I first run the application, the main ion-view part is not responding. After I use the Home button, and relaunch the app (without killing it from the memory) it works.

Details:
I have a login screen, where the two input fields work, but the login button doesn’t. For testing I added the Login Controller $scope to window, so I can call the login function from the console. It actually logs in, but from then only the header (nav-bar) and the footer-bar works, the main view still not responding.

I don’t really know, which part of my code would help anyone on debug, so I just leave it like this for now, maybe someone had issues like this.

Any suggestions? (if someone needs a specific part of my code just let me know)
Thanks :slight_smile:


#2

Hi!

As it turns out, the problem was with Ionic (v1.0.0-beta.6) and RequireJS. After I put the complete ionic loading before the requireJS initialization, it works.

Before:

<body>
    ...
    <script type="text/javascript" data-main="js/main" src="lib/js/require.js"></script>
</body>

and then in the requirejs I loaded angular, and then ionic.

Fix:

<body>
    ...
    <script type="text/javascript" src="lib/js/ionic/ionic.bundle.js"></script>
    <script type="text/javascript" data-main="js/main" src="lib/js/require.js"></script>
</body>

When I upgrade to the newest Ionic beta version, I’ll check it again, to see if it was fixed.

Edit:

Tested the Ionic v1.0.0-beta.8 and it still has the same issue.


#3

Jep so i’ve got it to work too.

But it works also, if you load only ionic.min.js before require config.

In your require config you have the ability to load your own angularjs version and ionic-angular.js :wink:

In german but maybe you can use google translate ^^:
http://www.flyacts.com/blog/tutorial-angularjs-mit-requirejs-und-ionic-framework/


#4

Yeah so require doesn’t play to well with ionic/angular since it loads things asynchronously. Another option for a module loader is browserify, which does play well with angular.


#5

Yeah but i want to load my modules asynchronously.
Why should not?


#6

See this issue,


#7

yeah but you only have to load ionic.min in your header before you load your require config file.

No problem ;).