Black screen on iOS only

I get a black screen when running my app in ios emulator or ios device. But it works fine in chrome/safari or on an Android device.

I get no errors in either xcode or safari debugger. If I console.log in $ionicPlatform.ready I can see it. But when I console.log in the controller it doesnt log it (I can see it if running in chrome/android though).

The app worked fine until I updated xcode to 6.1 and cordova to 4.0, Ive also updated ios-sim to 3.0 without success. Im using ionic beta13.
Ive tried to add and remove platforms/plugins 100 times

Please help! Ive spend 20h+ to fix this without success…

Did you tried to create another blank project and see if it works?

Fuck me sideways.

The problem seems to be that I had an empty view (a html-file with nothing inside) set as templateUrl in the state that is first loaded. When I added <ion-view></ion-view> to the file it works in the iOS emulator and device.

Is this suppose to happen? or is it a bug?! (I guess its a cordova error and not ionic?)

Other people seems to have had the same problem, I wonder if it was because of this to:




@tobbe, is this still an issue?

No, it seems like adding the ion-view tag solved it. But should having an empty template really result in the controller not being executed?

Hmm, I gave this example a shot.

It executes the controller with out any issues.

As far as the black screen, it’s a css thing. Should be fixed in the next beta. Until then, you can use,

ion-nav-view {
 background-color: #fff;
}

it only happened for me in iOS emulator or on a device. It always worked in the browser.

What only happens in the sim? The controller or the black screen?

The controller wasn’t executed so I got a black screen.
In my setup the “start view” HTML file was empty (not the abstract one). I think I got the same problem with a new project.

But I’ve solved it so its alright now :slight_smile:

(If you think it’s a ionic bug I could make a project for you to show the problem?)

sure, just throw it on github and I can take a look at it

I am still having the same issue and all my templates have have the ion-view tag on them

@munyanyika I was having this issue since last night in the ios emulator. I fixed it by adding a “./” in front of my template url in my ui-router state definition.

    templateUrl : './views/home.html',

Hope this helps.

1 Like

It doesn’t seem to work though, just tried it now and my whole screen went black

OK, after several hours of frustration, I found my issue. Hopefully this helps someone. Basically, the .js include inside of index.html was capitalized but the file was not. In Safari on my mac this was OK, on my iOS device, not so much. Fixing that cleared up my issues. Now onto the next issue, ha ha.

Thanks You Sir, You saved my day

Holy crap. Can’t believe that was the issue for me as well. The index.html file had App.js and the file itself was app.js

You just made my day sir. Thanks!

I was having this issue since last night in the ios emulator. I fixed it by adding a “./” in front of my template url in my ui-router state definition.

templateUrl : './views/home.html',

Hope this helps.

Why do u add “./” ?

I’m stuck with this problem about two weeks, please someone help me out !!

Me too…
I believe that ionic is not so good when comes to ios devices.
Android works great though

Did you solved your issue?