Bug 11272 - Getting "No class named AppDelegate" errors since upgrading to Xamarin.IOS 6.2.1
Summary: Getting "No class named AppDelegate" errors since upgrading to Xamarin.IOS 6.2.1
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 6.2.x
Hardware: PC Mac OS
: --- normal
Target Milestone: 7.0.6
Assignee: Rodrigo Kumpera
URL:
Depends on:
Blocks:
 
Reported: 2013-03-19 17:16 UTC by Paul DB
Modified: 2013-12-13 10:45 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description Paul DB 2013-03-19 17:16:32 UTC
Hi folks,

Upgraded to latest stable Xamarin.IOS (6.2.1) and started getting the following error immediately on trying to fire up in the IOS simulator.

This is on a late 2012 MBP Retina running OSX Mountain Lion.
Error:

Unable to instantiate the UIApplication delegate instance. No class named AppDelegate is loaded.


Stacktrace indicates its coming out of the Main class in my Main.cs class.

I have checked and double checked, the Register["AppDelegate"] attribute is in place on my AppDelegate class (and yes it is named exactly as per the registration).

I've downgraded back to 6.2.0 and everything is working fine again.
I have not made any code changes at all between down/upgrades.

So there's something up with the 6.2.1 upgrade.

Give me a shout if more details are needed.


Dump of my Xamarin Studio About below:

Xamarin Studio
Version 4.0.2 (build 18)
Installation UUID: d8fba736-ad1a-4bd7-93af-8e6714dab746
Runtime:
	Mono 2.10.12 (mono-2-10/c9b270d)
	GTK 2.24.16
	GTK# (2.12.0.0)
	Package version: 210120000

Apple Developer Tools
Xcode 4.6 (2066)
Build 4H127

Xamarin.Mac
Xamarin.Mac: Not Installed

Xamarin.Android
Version: 4.6.0 (Business Edition)
Android SDK: /Users/pdb/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
Java SDK: /usr

Xamarin.iOS
Version: 6.2.0.65 (Business Edition)

Build Information
Release ID: 400020018
Git revision: 2be11af94af70712cf550d12870275274b1ad399
Build date: 2013-03-08 07:22:12+0000
Xamarin addins: 11683a6440b38fa350cbe4d820f5cc6fee091295

Operating System
Mac OS X 10.8.2
Darwin pdb-macbook-pro 12.2.1 Darwin Kernel Version 12.2.1
    Thu Oct 18 12:13:47 PDT 2012
    root:xnu-2050.20.9~1/RELEASE_X86_64 x86_64
Comment 1 Sebastien Pouliot 2013-03-19 20:28:37 UTC
That message comes from iOS. That could be related to some modification in the registration code. However it might be hard to guess what exactly without a test case.

Could you try commenting your code:
* in your AppDelegate.cs (or where your [Register] attribute is located) and;
* changing other files from (Build Action) Compile to None

so that you get a minimal app and see if the issue still happen ?
Comment 2 Paul DB 2013-03-21 00:51:13 UTC
Sure thing, will do.
I'm under significant deadlines for the next two weeks, so won't be able to get to this until mid-April.
Comment 3 Paul DB 2013-04-19 02:53:54 UTC
I've tracked down the cause - I was running with the SGen garbage collector enabled as well as the Reference Counting extension.

What I found is that if I turned off the Reference Counting, then the issue went away and my app launched fine.  Having SGen enabled was fine, its specifically the ref counting that causes the error reported.

So it looks like there's a bug in there somewhere.

Let me know if you need further information.
Comment 4 Paul DB 2013-04-19 02:55:08 UTC
And to be clear, this is happening in Xamarin.IOS 6.2.3.0 as well (just upgraded to it, same issue)
Comment 5 Sebastien Pouliot 2013-04-19 10:38:57 UTC
looks GC related
Comment 6 Diego F 2013-04-25 16:07:53 UTC
I am able to reproduce it on the simulator, regardless of the SGen settings I use. On the device, it works only with reference counts disabled.  It all used to work before updating to 6.2.3.
Comment 7 Rodrigo Kumpera 2013-04-25 21:36:38 UTC
Could you please provide a minimal project that shows this problem?

I fail to imagine how sgen would screwup registration.
Comment 8 PJ 2013-11-19 17:04:22 UTC
This bug has been in the NEEDINFO state with no changes for the last 90 days. Can we put this back into the NEW or CONFIRMED state, or are we still awaiting response?

If there is no change in the status of this bug over the next two weeks, this bug will be marked as NORESPONSE.
Comment 9 Paul DB 2013-11-19 17:32:22 UTC
Sorry folks, completely forgot about these bug reports.

I turned off reference counts and pretty much moved on with life after my last comment on this.
Have been running without reference counting since then.

Out of interest, I just turned back on reference counting and ran up my IOS app in the simulator without this issue recurring.  Tried it on IOS 6.1 and IOS 7 simulators, no problems.

So it would appear that the issue is resolved.

Feel free to close this bug.


My current configuration is below:

=== Xamarin Studio ===

Version 4.2.1 (build 1)
Installation UUID: d8fba736-ad1a-4bd7-93af-8e6714dab746
Runtime:
	Mono 3.2.4 ((no/294f999)
	GTK+ 2.24.20 theme: Raleigh
	GTK# (2.12.0.0)
	Package version: 302040000

=== Xamarin.Android ===

Version: 4.10.1 (Business Edition)
Android SDK: /Users/pdb/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.3   (API level 18)
Java SDK: /usr
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06-451-11M4406)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01-451, mixed mode)

=== Apple Developer Tools ===

Xcode 5.0.1 (3335.23)
Build 5A2053

=== Xamarin.Mac ===

Xamarin.Mac: Not Installed

=== Xamarin.iOS ===

Version: 7.0.4.209 (Business Edition)
Hash: 23a0827
Branch: 
Build date: 2013-11-11 16:04:00-0500

=== Build Information ===

Release ID: 402010001
Git revision: 844a84fe0aa0cb5f986d4e3c4807a51487d07845
Build date: 2013-11-13 22:12:16+0000
Xamarin addins: 97e44e4863da6c479427794457637e75b3d22600

=== Operating System ===

Mac OS X 10.8.5
Darwin localhost 12.5.0 Darwin Kernel Version 12.5.0
    Sun Sep 29 13:33:47 PDT 2013
    root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64
Comment 10 Sebastien Pouliot 2013-11-19 17:37:28 UTC
Thanks for confirming!
Comment 11 PJ 2013-12-11 18:46:03 UTC
This fix is planned to be released with Xamarin.iOS 7.0.6, which should hit the beta channel before December 23rd.
Comment 12 Mohit Kheterpal 2013-12-13 10:45:23 UTC
As per comment 9, this issue does not exist any more.

Hence closing this issue.