When I debug my Xamarin.iOS project from Visual Studio, it builds, installs on the simulator, and launches the app without issue. But on launching, I'm seeing a bunch of Debug tracing from a method that doesn't even exist in my C# code anymore. I can also set breakpoints on the class from which I removed the method at the same line numbers where this method used to be, and I will see the removed method in the call stack when the debugger stops.
I've closed and reopened Visual Studio, reset the connection to the Mac build server, cleaned and rebuilt my solution, and manually deleted the solution output. On the Mac, I've closed and reopened the simulator, and tried Reset Content and Settings, which does clear out the app. But the situation still persists, even after all that. Is there something else can I try on the Mac to make sure that all cached copies of old code have been deleted?
In your project folder delete the bin and obj folders. This works for me but is still annoying.
Check your Configuration Manager (the drop down with Debug, Release etc) and check that all the projects are being built. It usually unchecks all the projects you are working with for some unknown reason.
This means that it isn't rebuilding all the projects and it hence shows an old version.
As per your comment of rebuilding each project, this is a classic sign of the projects not being checked to be built on run and why you have to do it manually.
In the iOS Simulator (on the Mac) click the "Reset Contents and Settings" entry the main menu.
Well this worked with my Android project suffering from the same issue:
Right click on Android project then select "Properties".
Select "Android Options" then "Packaging".
Un-check the "Use Shared Runtime" options.
then it worked normally
I had a similar problem (though on an Android emulator).
What didn't work for me:
restarting the computer
restarting Visual Studio
deleting bin / obj folders
going into Configuration Manager (Debug / Release / Configuration Manager) and ticking everything there - everything was ticked
changing the version of the app in the manifest
What worked for me?
Uninstalling the app from the emulator and then running Debug again.
It was an Android emulator, so I uninstalled by clicking on the app icon and holidng for long, and then dragging it to "Uninstall App". On an iOS simulator it should be similar.
In my case I had to enable all architectures:
Android project properties
Andrid Oprions
Section Anvanced Tab
Select all architectures and rebuild
I still have this problem with iOS simulators. My solution:
Unload the iOS project
Reload the iOS project
Build as usual
I do the above when I change simulator device.
Related
I have an issue when building for iOS in Xamarin Studio:
I open Xamarin Studio and create a Single Project View App for IOS, I then run the project, but the project does not load onto the simulator all I get is the message
"Waiting for the debugger to connect to the iOS Simulator".
I have xcode installed on the machine.
Does anyone know how to solve this issue?
Try launching XCode directly - often after an update XCode will require you to accept a new EULA before it will launch, which can prevent other apps from launching XCode (or its components) automatically.
Other options to fix this issue:
You could also try to Reset Content and Settings... on the actual simulator menu, then build again.
Re adding the simulator: Open Xcode > ⌘⇧2 to open Devices > Select the simulator device you are trying to use > Right click and delete it > Then add it again, bottom left + button.
If this doesnt work try checking for any errors in Console.app when building to the simulator.
I always ran into issues when there're different Xamarin versions on the MAC and the Windows PC. Also cleaning the solution, re-connecting the MAC and rebuild the project is always worth a try.
First of all open iOS Simulator after that clean your project solution and project, then run your project it works for me.
I'm sure it used to be possible to do this but I don't seem to be able to run the Xcode project generated by Titanium in Xcode. The app installs in the simulator and starts but immediately stops with the following runtime error:
Could not find the file app.js
I'm running Xcode 7.2.1 with appc cli 5.1.0 / ti CLI 5.0.5. The app is built with 5.1.2.GA.
Running the app in Xcode would provided access to instruments and perhaps better insight in native level crashes etc.
What you are trying to do isn't officially supported, but it is possible.
First, do a clean build of your Titanium app from Appcelerator Studio (or the command line). Then open the Xcode project from the build/iphone directory.
Next, open Xcode's preferences and go to the "Locations" tab. Click the "Advanced" button under the "Derived Data" field. Set the build location to "Custom" and "Relative to Workspace". Lastly set the "Products" location to build/Products and the "Intermediates" location to build/Intermediates. Click "Done" and close the preferences dialog. You only need to do this once.
You can now build your app from Xcode, but there are a few gotchas:
You cannot clean the Xcode project. You'll nuke all your app resources.
You can only build for the same target as you built the Titanium app for in Appcelerator Studio. In other words, you will probably have issues building the Titanium app for iOS simulator, then try building it for device from Xcode. Don't do this.
Again, this is currently not supported. I'm working on greatly improving this developer experience, but it's going to take a while. In the meantime, I hope the above helps.
I am trying to get an iOS project started with Xamarin.iOS for Visual Studio linked to a Mac build host and connected iPhone.
I have started dummy projects in Visual Studio on my PC, Xamarin Studio on the Mac, and XCode 7 on the Mac. They all share this problem.
I have tried running the build on both the physical iPhone and a Simulator on the Mac. The problem persists for both despite all my efforts.
The problem is this: The first version ever built of the test app is the one that runs. If I make ANY changes and rebuild, those changes will NEVER be reflected in the app running on the phone or simulator. It will ALWAYS run the first build I ever made, and the debugger refuses to attach.
I have tried deleting the app from the phone between builds. I have tried deleting all bin and obj files from all projects in the Visual Studio solution between builds. If I could find any similar files on the Mac for Xamarin Studio, XCode, or the Xamarin Mac Build host, I would delete them too, but I'm unfamiliar with the build process or file system of a Mac. Still, this is a problem that shouldn't be happening Regardless.
I have even tried restarting Visual Studio. I would have tried restarting the other parts of my setup (the Xamarin Build Host, Xamarin Studio, XCode, the iPhone, and the iPhone Simulator), but decided not to bother, since restarting components between every build is unacceptable and not a solution.
All searches I do on the web only bring up topics related to Apple Provisioning for test deployment. Nothing useful. Very frustrating. Does anyone have any idea what might be going on here?
Edit: Correction. Changes made in Xamarin Studio on the Mac are reflected on build/run, but not from Visual Studio on the PC linked via Build Host, or from XCode.
Also note: All 3 test apps use the same app identity in their plist files ("com.somecompany.-"). And when building in one environment (say Visual Studio) it WILL overwrite the version from the last environment used (say XCode), but it will still use the first version ever made in the environment being built from.
So for example, if the main page on the Visual Studio project has a label saying "This is the VS version.", and the XCode project label says "This is the XCode version.", I can build/debug in either one, and the label will say the expected thing on the phone.
But if I change those labels in some way, like by adding " duh..." to the end of them so they say "This is the VS version. duh..." and "This is the Xcode version. duh...", no matter how many times I build and run in either environment, the app will still just say "This is the VS version." or "This is the XCode version."
Partially solved. (Solved for Visual Studio with Build Host, not for XCode)
In Visual Studio, the test project is a Xamarin.Forms solution, meaning that it consists of a library project--"TestApp (Portable)"--and other projects for each platform it should build for--"TestApp.iOS", "TestApp.Driod", etc.
By right clicking on the solution and bringing up its properties, then going to Configuration Properties -> Configuration, I was able to see that the library project was not set to build for some reason. So the iOS project would build, and everything would LOOK like the compiler was doing it's job, but the iOS project was still building off the non-rebuilt library.
After checking the box for "Build" on the TestApp library project and applying, everything worked. The debugger even attaches again.
Unfortunately, XCode still remains an unintuitive and mysteriously useless piece of scrap. Answers regarding its behavior on this matter would still be appreciated.
I'm trying to debug an iOS project in XCode 6.4. Recently, none of the breakpoints are working (they did before), while I'm running the iOS Simulator. The debugging area only starts if I manually attach it to the process. I've looked through the project build scheme and settings, and there's nothing to suggest that I've turned off or changed the debugger in any way.
The problem only occurs with this specific project in XCode. I even reinstalled XCode to no avail, so I assume the problem must be specific to this project/workspace.
Any ideas why the debugging is not automatically attaching to the process? Or a workaround?
Thanks!
How do you correctly use Application Data bundles in Xcode 6? I exported a .xcappdata file from a device, added it to my workspace, and selected it in the Run Options of a scheme.
Whenever I try to run the simulator with iOS 8.0, I get the following error, even on repeated launches, manual launches, etc:
Application data package not copied to the Simulator
It appears you are running 'REDACTED.app' on the iPad Air Simulator for
the first time, and therefore do not yet have a data folder created.
The application data package will be installed the next time you run
your app in the Simulator.
Trying to use the simulator with iOS 7.1 crashes Xcode.
Does this feature just not work anymore with the changes made to the filesystem?
Tried again on Xcode Version 6.1.1 (6A2008a) and it (sometimes) crashes Xcode now, hopefully that means it will be get fixed soon...
I'm using Xcode 8.1 and when I tried to add the .xcappdata file Xcode crashed.
I solved it by cleaning the app and then I tried to add it in another target and it worked. Afterwards I tried to put it again in the target I wanted it in and it worked as well.
Unfortunately I'm not sure about which of these steps fixed it but I hope it to be useful to someone!
You can try to clean the Derived Data which contains all the intermediate build information like debug- and release-built targets. And you probably can select the Simulator, choose the iOS Simulator from the menu. Then, choose Reset Content and Setting.
Sometimes, it's just some bugs in the XCode. And I think Apple is handling that when your issue is marked by duplicate by them.