Bug 6525 - System.Exception: Wrapper type 'MonoTouch.CoreBluetooth.CBCentralManager' is missing its native ObjectiveC class 'CBCentralManager'
Summary: System.Exception: Wrapper type 'MonoTouch.CoreBluetooth.CBCentralManager' is ...
Status: RESOLVED NORESPONSE
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 1.0
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-08-14 08:11 UTC by Alex Anikin
Modified: 2013-12-05 18:35 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:
RESOLVED NORESPONSE

Description Alex Anikin 2012-08-14 08:11:42 UTC
Hi -

I have strange error in runtime. Mono 5.3.5 + iPad 4.2.1
I build in Debug/iPhone.
When I start app get this:
Connected to: iPad tdo
Launching /private/var/mobile/Applications/50310A4B-30E7-4BE2-B1B3-7A60B9D1F3A3/FileManager.app -debugtrack -monodevelop-port 10000 -connection-mode usb
2012-08-14 14:19:35.033 FileManager[1863:307] Could not load 'monotouch' for registration: System.Exception: Wrapper type 'MonoTouch.CoreBluetooth.CBCentralManager' is missing its native ObjectiveC class 'CBCentralManager'.
  at MonoTouch.ObjCRuntime.Class.Register (System.Type type, System.String name, Boolean is_wrapper) [0x006ad] in /Developer/MonoTouch/Source/monotouch/src/ObjCRuntime/Class.cs:358 
  at MonoTouch.ObjCRuntime.Class.Register (System.Type type) [0x0004f] in /Developer/MonoTouch/Source/monotouch/src/ObjCRuntime/Class.cs:191 
  at MonoTouch.ObjCRuntime.Runtime.RegisterAssembly (System.Reflection.Assembly a) [0x0009f] in /Developer/MonoTouch/Source/monotouch/src/ObjCRuntime/Runtime.cs:96

What can be wrong? 

Thanks.
Comment 1 Zoltan Varga 2012-08-14 23:43:25 UTC
-> mt.
Comment 2 Alex Anikin 2012-08-15 04:34:06 UTC
What is this?
Comment 3 Alex Anikin 2012-08-15 04:34:34 UTC
I got it. Sorry.
Comment 4 Sebastien Pouliot 2012-08-15 08:20:12 UTC
It's not clear. Are you using CoreBluetooth in your own application ? or some libraries, native or managed, that could be using it ?

If so then it's only available for iOS5 and later.

From: http://developer.apple.com/library/ios/#documentation/CoreBluetooth/Reference/CBCentralManager_Class/translated_content/CBCentralManager.html

Availability	
Available in iOS 5.0 and later.
Comment 5 Alex Anikin 2012-08-15 09:09:27 UTC
We don't use Monotouch.CoreBluetooth namespace.
Comment 6 Sebastien Pouliot 2012-08-15 09:14:52 UTC
Then it should not be part of the application (i.e. the linker should have removed it) and should not be hit at registration time.

Can you please attach (you can mark the attachment as private) your "Build Output" (which you can find inside MonoDevelop's Error List pad) ? thanks
Comment 8 Sebastien Pouliot 2012-08-15 11:05:33 UTC
Your build log looks fine (i.e. the linker is not disabled).

Something in your application (either your code or 3rd party code) must bring a dependency (directly or indirectly) on MonoTouch.CoreBluetooth.CBCentralManager. Otherwise this type would not be part of the linked monotouch.dll assembly (and would not be trying to register itself).

Can you attach the following file (it should be linked and might give some clues if it's an indirect requirement*):

/Users/aanikin/Projects/OS33Drive/OS33.iOS/FileManager/bin/iPhone/Debug/FileManager.app/monotouch.dll

or (even better if you can*) zip the entire .app and attach it to the bug report (mark it private) and I'll be able to see why this type was not linked out.

* otherwise I won't be able to go back to the original code that requires it
Comment 10 Sebastien Pouliot 2012-08-15 17:06:29 UTC
No, that's too big. This is the _unlinked_ version of the monotouch.dll (and it will contain every type) and this is not what should be included inside your application (since your build log shows linking to be enabled).

The file: /Users/aanikin/Projects/OS33Drive/OS33.iOS/FileManager/bin/iPhone/Debug/FileManager.app/monotouch.dll

should be quite smaller, since the linker will have removed all types that your application does not require. That version might give me some clue why CoreBluetooth is still part of your application.
Comment 11 Alex Anikin 2012-08-15 18:15:49 UTC
Which file should I include to fix this?
Comment 12 Sebastien Pouliot 2012-08-15 21:23:45 UTC
After a full, device build the file:
/Users/aanikin/Projects/OS33Drive/OS33.iOS/FileManager/bin/iPhone/Debug/FileManager.app/monotouch.dll
should *help* me figure out what's going on. 

However it might not be enough and I might need a ZIP file of the whole directory: /Users/aanikin/Projects/OS33Drive/OS33.iOS/FileManager/bin/iPhone/Debug/FileManager.app/ 

The goal is to find what code is bringing the MonoTouch.CoreBluetooth.CBCentralManager type inside your application (something has a reference to this type or the linker would have eliminated it).
Comment 13 PJ 2013-11-19 17:04:57 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 14 PJ 2013-12-05 18:35:09 UTC
This bug has not been changed from the NEEDINFO state since my previous comment, marking as RESOLVED NORESPONSE.

Please feel free to REOPEN this bug at any time if you are still experiencing the issue. Please add the requested information and set the bug back to the NEW (or CONFIRMED) state.