Xamarin.iOS - Assets won't update - xcode

I'm developing a xamarin app for iPads. When I try to change asset for splashscreen/launchscreen, it remains the same no matter what I do on ipads, even tho on storyboard it looks correct. What could possibly be the problem?
I already tried to add the references to project file, clean & rebuild, delete bin and obj files with no results, create new asset and refer to it (it just shows black screen then)
UPD: Problem kinda solved itself when I debugged it on different device, splashscreen was correctly shown. I assume it's a cache issue or something.

Related

After updating Xamarin and Xcode, failing to run app on iOS device

I recently updated Xcode and Xamarin and when I deploy my project to my simulator on iOS it works well. But when I however try to use my phone that has been working succesfully for many months now it does not work and I get this error in the log:
System.IO.FileNotFoundException: /Users/Carlos/Projects/Myproject/iOS/obj/iPhone/Debug/build-iphone8.1-9.3.2/ibtool-link/LaunchScreen.storyboardc/02J-Ip-oVM-view-Ze4-5b-2t2.nib does not exist
My bundle identifier matches my provisioning profile that I have made on apple.
I have tried to delete the obj and bin folders in the projectmap/mainmap (not the obj and bin-folders inside the iOS folder) but without any success. I have also rebuild the project and cleaned it but the problem still remains.
When I create a brand new project however it works. So it seems to be a problem with old projects only.
In the map on my old project I cannot even find "ibtool-link" and if I check the newly made project I just made i can see it there and other maps as well. Can I solve it by copying them over? Or is there a better solution?
Any ideas what it might be?
You might try the suggestions (I saw at least 2 different ones) in this post which are:
simply right click on the xib and open it in IB. I then turn around and close it in IB and that gets me past the error.
And
make sure 'Main Interface' empty in info.plist.
Remove Bin and Obj folder.
Also you might try deleting the build cache on your mac by going to /Users/<Your User Account Name>/Library/Caches/Xamarin/mtbs/ and then delete the folder that is the same name as your solution (there might be 2, one with iOS in the name, delete both). This will get recreated when you rebuild your solution.

Xamarin displaying wrong images

I have a xamarin forms project that started behaving strangely... It started randomly replacing images with different images from the resource folder. It seems to only be happening in the Android project, iOS is behaving correctly. I've removed the recently added images and readded them, clean, rebuild, nothing sees to be helping. The images that are getting changed are not being overwritten, and the code references the correct file.
Has anyone run into a similar issue before? Thoughts on how to possibly fix this?
It is a common behaviour, What I usually do is:
Restart Xamarin Studio
Go to your project Android location and Delete the bin/Obj folders.
Do a full clean, rebuild of your project
Delete the Android app from the device
This is the my day to day script. Hope it helps!

Images files still appearing in app even after deleting every supporting files Xcode 6.4

I deleted all my supporting files form Xcode's project and still when I run the app some how some images are still there/appearing but when i search in the search box for the file at the bottom left of the project. It says that there no file of that name in my project does anyone know why or how this is happening? And theres nothing in assets I'm using Swift if it helps Thanks
Old things that you delete from the project are not deleted from the built app, or from the intermediates along the way. To do that, you need to clean all the caches, and also clean out any old built versions (e.g. clean the simulator, and also delete from the device if you've been testing on a device).

Any explanation for wrong images showing up?

Some background. Until I redo this part of the app, for now, I've dragged a bunch of images into my project. They are called Landscapexx.jpg and Portraitxx.jpg, where xx is a number from 0 to the total number of pictures (minus one) for that orientation.
At some point, I replaced the images used in the project. But the original images are still showing up on my device (but not in Xcode). Using NSLog to confirm which image is being loaded, I then look up the image with the same name in Xcode. Sometimes it's the same image. Sometimes it's not.
At first I thought the problem was that when building the app again the data remained. That would be a reasonable explanation. However, when I deleted the app, acknowledging that the data would be deleted, that did not solve the problem. Could this be a cache issue? If so, how do I clear the relevant cache?
One last thing. The images that appear incorrectly on the iPad have the project name checked in the file inspector.
The way I'm loading the images, by the way is using NSString *newImageName = [NSString stringWithFormat:#"Landscape%d.jpg",n];, for example. So the file simply needs to be in my project space somewhere, I thought. If there are two copies, I have no idea where the second one would be. I don't see them in Xcode.
P.S. If I run the app in the simulator, I get the same images as on Xcode. This suggests the errant images are cached somewhere in my iPad. Since deleting the app didn't take care of the problem, is there something else I can try?
EDIT: I found something that may point to an issue. If I go to the Build Phases screen and open the Copy Bundle Resources item, all the images are listed there. However some of them don't have the ...in projectname after them. These same items have the project checked in the file inspector. Not all the images are this way. What do I need to do to ensure all the files are correctly in the project?
I suggest deleting the app from the phone, cleaning the project, and rebuilding the app. This happens to me on occasion and this usually fixes it.
I figured it out. Going through all the menu options in Xcode, I found an option called Clean in the Product menu. I selected it, rebuilt the app and all is fine now. This option apparently clears out the precompiled stuff that occurs the first time a project is built.

Xcode shows old, deleted xib files

I've searched all over and haven't found any help...
I built a small test app with two UIViewControllers and their corresponding xibs. Things were fine, then I made some changes to both xibs but when I build and run, I get the old views. I've tried deleting the build folders, running in the simulator and device, cleaning all targets and still the same, old, broke-down xibs that I totally changed are still showing up. I've restarted all the Xcode apps and even my computer.
Getting pretty irritated!
EDIT: I never did figure out what the problem was. Basically, once I had built a project, it remembered the first xibs I made and wouldn't recognize changes to them. If I told a view controller to load from a different, valid nib name, it'd complain that the old one wasn't there.
I reinstalled Xcode and now it all works again. Sheesh.
Try deleting the app from the simulator (hold down on the app's icon to get to jiggle mode, then click the X by the app) and from your device. Then let Xcode reinstall it.
just clean the build using
Product -> Clean
menu.
Just modify your XIB files a bit, then save them, xCode will detect a modification (last modified date in the file system) then load the xib from its actual path, and not from a cache-path :P
I just found (and fixed) a related problem — one that demonstrates similar symptoms but whose root cause is slightly different.
In particular, the symptoms I observed were that my iPad app would initially display an old storyboard image for the first page and, after a short delay, would bring up the most recently edited story board contents. I went through most of the above machinations to no avail.
The problem is that the iPad loader first just dumbly loads your app's launch image into the screen. You usually set up this image as part of the early administrative setup of the app in XCode. At launch time, while the end user is considering the content and cogitating about where to touch the screen, the application is in the mean time madly getting itself ready, un-archiving the xib/nib/storyboard, and doing the real work of getting ready.
In the ideal situation the provided launch image is pixel-for-pixel the same as the one generated by the nib-unarchiving-process. However, if you forgot to update your launch image after updating the story board, you'll see an image shift at the completion of the unarchiving.
I wouldn't have suspected this as the problem except that I had read Jef Raskin's description of how he did exactly this on the Canon Cat word processor to provide the illusion of an instantly ready application: it takes advantage of the fact that the typical human response time to an application startup is on the order of seven seconds — plenty of time for even a floppy-based system to load and overwrite the bitmap facade that the loader sets up. Sometimes, it's good to have read a bit of arcane history. Jef would of course later go on to found a project whose name was Macintosh, and the rest is history — and this bug.
Not sure whether this helps, but I just had this.
It took me days to work it out. In my case I enhanced an existing Xib file. The changes I applied in interface builder never appeared in the app.
Eventually I found the cause. I had my FilesOwner view outlet set to a subview below the top view. When I enhanced the view I did this as an extension to th top view. Thus the changes never appeared when running the app.
Changing the view outlet to the correct view ( the top view in my case ) did the trick and it all worked fine ...
I know steve has found a work around but the problem is not in the XIB files at all. Xcode does not update the YouApplication-info.plist file to
If you open it up you will see the line: Main nib file base name. You must change the value to reflect your desired NIB file name
I had this problem, and it was a result of xcode continuing to copy previously compiled xib's - even though the source file was deleted, the build cache wasn't. Product > Clean and then recompiling solved it.
I just had this issue, just delete the app from the simulator.
Then do a clean on your project.
In xCode,
go to the Product menu,
select Clean.
Or just press Shift+Command+K!
I ended up recreating the xibs from scratch and that worked. Very frustrating.
you can try to modify your XIBs a bit, so xCode will detect a modification through the last modified date in file system. then it will load the xib from its actual path, an not from xCode cache.
I had the same problem, but i solved it by changing the datetime of my system to today. And re-saved the xib. I was testing the local notification.
Just an assumption, not sure if that really caused it: I finished a XIB that worked fine in the simulator and on an actual device. I then changed it to be localised in Xcode 4.5.1. The changes I did after that were not synced to the device until I manually deleted the app from the device and reinstalled via Xcode.
Deleted derived data, cleaned project and build. Old xib was magically removed. :D

Resources