Question

I'm working on an app that works great in both simulator and on actual iOS devices, when I build using debug mode. But as soon as I build in release the app crashes as soon as I try to use any of the bundled images. I have a folder in my project called "Images" with a capital i. And using my images like this,

new UIImage ("Images/man.png");

The problem, I think, is for some reason Xamarin Studio changes the name of the folder when I build in release mode to "images" causing the app to crash because iOS is case sensitive. I have attached a file showing the build output. Also when I look in the payload folder (inside the built IPA) the folder name is with a small i instead of a capital I.

  • The folder is called "Images" in Xamarin Studio and in the csproj-file
  • Inside the IPA file the folder is called "images"
  • The app works perfect in debug mode but not in release

Anyone know why know what's wrong? Any help is appreciated!

enter image description here

Was it helpful?

Solution

I got this answer on Xamarin iOS forum,

"The first thing I would suggest is running a Clean on all your builds, and also manually verifying that all of your IPA's get deleted too. Also delete the app from the device. Then rebuild and try again.

If you still have the problem, the next thing I would try is deleting the Folder from your project, then re-adding it and it's contents."

http://forums.xamarin.com/discussion/10289/xamarin-studio-changes-folder-name-when-building-in-release-mode#latest

What finally fixed my problem was to delete all contents of the bin folder and then rebuild the solution. It feels like Xamarin Studio got confused by an old IPA file in the bin folder (?).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top