xcode simulator not working but corona simulator works fine?

xcode simulator not working but corona simulator works fine?

it doesn’t work when I build it to the Xcode simulator or to my phone. whats up?

I am having the same issue.

When we hear “It works in the Corona simulator but not on a device” (and the Xcode simulator counts as a device here) the first, most likely cause is that you have a case sensitivity problem.  Devices (Including the Xcode simulator) are case sensitive where the OSX and Windows are not.  If you have a file name:  “image.PNG” but refer to it as “image.png”, it will work in the Corona simulator but fail on you on device or the Xcode simulator.

The actual error is displayed in the device’s console log.  If you do not know how to find that and read it, please read this tutorial first and then see what error is happening.  All we can do is guess with out knowing what’s in the log.

http://coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/

Rob

this is all the errors I am getting when I build it to Xcode 

You need to make sure your build.settings are correct and you don’t have filenames that have a case mis-match.  Do you get errors in your log when putting it on device?

how do I change the build.settings file? and that screen shot is the console of my phone in the Xcode organizer

The build.settings is a file in your project where you main.lua is.  The tutorial above should show you how to get information from the console logs depending on where you’re trying to run the app.

Rob

2/22/14 1:07:23.063 PM defaults[16378]: 

Domain (/Users/MaxNelson/Desktop/FlappyTurd.app/Info) not found.

Defaults have not been changed.

this is all I could find.

Do you have a file or folder named “info” in your project?

nope and this is the console from when I start up my app to when it breaks.

Its the highscore that isn’t working

Well that would be why its not working.  You are trying to reference something called highscoreFile at line 619 of our game.lua.  This could be a scoping issue.  You should be able to figure out why your code thinks highscoreFile is nil at that point of your program.

Rob

I removed all of the scoring in my app and it works fine on a device but I need the score and highscore so I rewrote the whole thing and it works on the corona simulator but not on a device. I’m so confused.

Max, I don’t know how to explain this any easier.   You have two things going on and they are probably related. 

Filenames are case sensitive on the device and they are not on the simulator.  This is 95% of the “It works on the simulator and doesn’t work on the device” errors.   Your specific error says that the variable “highscoreFile” is nil.  This tells me that however you have coded your high score file handling has to be broken.  You may be trying to open a file that doesn’t exist.  Let’s say you save the file:  highscore.txt  but you try to open and read HighScore.txt.

On the simulator this will work. On device it will fail.  Since I don’t see your code, all I can do is guess, but I’m thinking highscoreFile is supposed to be a file handle to the file you are saving your data too.  If you try to open that and the file name has a case mis-match it will be nil.

well its not that but jhastran helped me and it is fixed! Im so happy turns out the error was also in the corona simulator but it was not displaying it. 

I am having the same issue.

When we hear “It works in the Corona simulator but not on a device” (and the Xcode simulator counts as a device here) the first, most likely cause is that you have a case sensitivity problem.  Devices (Including the Xcode simulator) are case sensitive where the OSX and Windows are not.  If you have a file name:  “image.PNG” but refer to it as “image.png”, it will work in the Corona simulator but fail on you on device or the Xcode simulator.

The actual error is displayed in the device’s console log.  If you do not know how to find that and read it, please read this tutorial first and then see what error is happening.  All we can do is guess with out knowing what’s in the log.

http://coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/

Rob

this is all the errors I am getting when I build it to Xcode 

You need to make sure your build.settings are correct and you don’t have filenames that have a case mis-match.  Do you get errors in your log when putting it on device?

how do I change the build.settings file? and that screen shot is the console of my phone in the Xcode organizer

The build.settings is a file in your project where you main.lua is.  The tutorial above should show you how to get information from the console logs depending on where you’re trying to run the app.

Rob