Error debugging the IOS Extensions in Visual Studios Xamarin - ios

The issue I am having is that I can't debug the share extension. I've tried setting break points in the share extension and they are never hit. If I attempt to debug the main app, all works as expected.
This is what I've done. Any help is appreciated!
I tried setting the share extension project as the startup project and I've tried setting multiple projects as startup and then when I run I get the following error:
In the IDE..."Launching Share Extension" and then after a few minutes the error "App has terminated"
Has anyone been successful at debugging an IOS extension using visual studios Xamarin?

As mentioned by SushiHangover, debugging iOS extensions in Visual Studio is available in 4.3.0.550 (RC) and introduced in 4.3.0.405.
As of this writing, 4.3.0.550 is available through the beta channel.
As a note, make sure that your Mac Build Agent is running on the same version.

Related

Xamarin iOS - Archive for Publishing: Could not resolve reference Mono.Android

I've been developing a Xamarin app for both Android and iOS, and after publishing to Google Play now would like to launch on the Apple App Store as well. I have installed Visual Studio 2019 on a Mac, and can successfully test a release version of the app on a simulated device. Now, following this guide on publishing to the App Store I need to create an archive for publishing. However, when doing so I get the lovely error:
Could not resolve reference. Could not locate the assembly "Mono.Android". Check to make sure the assembly exists on dirk. If this reference is required by your code you may get compilation errors.
I never reference Mono.Android directly in my code, and there are also no compilation errors when building and executing the Xamarin.iOS project. There are also several versions of the Mono.Android.dll on disk, located at /Library/Frameworks/Xamarin.Android.framework/Versions/11.0.2.0/lib/xbuild-frameworks/MonoAndroid/[version]/Mono.Android.dll
How do I resolve this?

Issue with using On-Demand Resource through Xamarin.iOS on iOS simulator

I have run into an issue where I am unable to access assets tagged for use in Apple’s On-Demand Resource feature through a Xamarin.iOS app, but only when run on the simulator. This only occurred after updating my environment. I was previously on Visual Studio for Mac version 8.3.9 and Xcode version 11.2.1, and my app was able to access ODR resources without issue on both simulator and physical device.
Now I am on Visual Studio version 8.4.2 and Xcode version 11.3.1, and my app is not functioning correctly. However, I am only seeing issues when running on an iOS simulator (for any iOS version). I can build and run on a physical device (running iOS version 13.0)and am seeing no problems.
I am creating and tagging an asset for use in Apple ODR through Visual Studio for Mac. I have a ZIP file that I add into my app’s iOS project directly as a resource. In its properties, I set the BuildAction as BundleResource, select “Do Not Copy” to output directory, and give it an On-Demand Resource tag.
When I build my solution, I can see this ZIP file nested in a *.assetpack directory under bin/iPhone/Debug/device-builds/iphone12.3-13.0/OnDemandResources. I believe it is supposed to be put in bin/iPhone/Debug/OnDemandResources/ instead. When I run the code that calls NSBundleResourceRequest’s BeginAccessingResourcesAsync, it seemingly does nothing. I see the following error message in the Application Output debug window in VS after that function is called:
Begin: Request 0x0x600002566100 response: Error: Error Domain=NSCocoaErrorDomain Code=4994 "The requested application data doesn’t exist." UserInfo={NSLocalizedFailureReason=InvalidTag}
There’s no other error or exception being thrown. When I try to get the resource path from the NSBundleResourceRequest.Bundle object, it expectedly returns null.
Any reason why this is happening, and why this is only occurring on the iOS simulator and not on a physical device? I haven’t been able to find anything useful when searching for the above error message. Did something change in Visual Studio regarding how bundled assets are built in Debug mode?
Not really an answer, but more of a workaround. Using version 8.3.9 of VS for Mac seems to not throw this error, so I reverted back to that version

Unfortunately "app_name" has stopped in xamarin forms

After upgrading to Xamarin 4.3.0.784, my app is crashing every time. And I am getting notification "one or more errors occurred" in Xamarin.Android.common.Debugging.Targets file under GetPrimaryCpuAbi tag.
I did some research about this issue on few days ago, I can give you some tips on the following:
1-try to disable Fast Deployment in android build options(Release Mode).
2-try to disable Shared Shared Runtime in android build options(Release Mode).
3-actually you did not need to enable all architectures check-boxes under Supported architectures.
and if you want to Deal with Startup Crashes, check the following link:
https://developer.xamarin.com/guides/insights/platform-features/advanced-topics/dealing-with-startup-crashes/
and to avoid Xamarin.forms app crashes for unknown reason, try to get latest stable version of Xamarin.forms package from nuget.org.
Finally I found the solution. I opened the project with visual studio, disabled "Use shared runtime", enabled all supported architectures. After restarting, now it is working.

Xamarin IOS MonoTouch (Unable to Build Successfully on any profile other than Debug in Visual Studio 2015)

Hi guys I have been struggling with this error for a few days now and I could not find out what's really going on, basically it throws an error "error : Failed to compile the generated registrar code. Please file a bug report at http://bugzilla.xamarin.com" i got the complete output of the build in this link
https://forums.xamarin.com/discussion/87135/error-when-building-in-ad-hoc-profile-to-be-deployed-to-itunes-connect-for-test-flight/p1?new=1
building in Debug mode and iPhoneSimulator works fine and infact can run through the App without any problems... however when I want to use Ad-Hoc so I can produce a signed App for test flight so it can be bug tested by my beta testers I can't because of that error, please note I got no experience in Objective-C and my App in concern is built on C# Mono using Xamarin for Visual Studio 2015, hope you guys can help me out thanks...
Turns out the error was caused by a file with register.cs name that caused the issue thanks to the bug helpers of Xamarin i was able to remove the issue and was able to build the IPA file, for those who will encounter this try to watch out for the class names you use on your MonoTouch Projects

Xamarin iOS debugger not hitting breakpoints

Yesterday morning as I started working on a Xamarin iOS application when my debugger stopped working. I can place breakpoints but as soon as the application starts the breakpoints become hollow like a red donut. I've rebuilt/cleaned project multiple times, I've also wiped obj/bin folders and nothing seems to work. I can't hit breakpoints.
This doesn't happen to all my classes, it looks like it applies to classes where an async function is used however this isn't always the case.
I also get a message in my debugger window which may have only started showing since this bug.
Xamarin.iOS: Successfully received USB connection from the IDE on port 10000, fd: 7
Xamarin.iOS: Processing: 'start profiler: no'
Xamarin.iOS: Profiler not loaded (disabled)
I'm using Xamarin Studio 6.0.1 Build 9 Indie
I have found solution related to this issue: https://stackoverflow.com/a/34211506/4627978.
Also be sure, that you set Debug configuration in Xamarin Studio (not Release, AppStore, etc.) and enable debugging in Project Options > Build > iOS Debug > Enable debugging
After all this don't forget Clean/Rebuild.
I had this same problem and I got it working after changing the iOS project property Linker Behavior to Don't Link.
Make sure you have the iOS SDK updated to what you have in Xamarin.
Here you go with the solution for Visual Studio:
Right-click your project -> Properties
iOS Debug
Enable debugging (and perhaps also Debugging over WiFi)

Resources