#  Error:  "\_OBJC\_CLASS\_$\_MKMapView", referenced from:

**URL:** <https://forums.fusetools.com/t/error-objc-class-mkmapview-referenced-from/2682>\
**Category:** General\
**Created:** [July 22, 2017, 9:59am UTC](https://forums.fusetools.com/t/error-objc-class-mkmapview-referenced-from/2682 "2017-07-22T09:59:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![poul.kg](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/poul.kg/32/585_2.png) [@poul.kg](https://forums.fusetools.com/u/poul.kg)\
**Post date:** [July 22, 2017, 9:59am UTC](https://forums.fusetools.com/t/error-objc-class-mkmapview-referenced-from/2682/1 "2017-07-22T09:59:38Z")

</div>

I was following this tutorial [https://www.fusetools.com/docs/native-interop/native-ux-components](https://www.fusetools.com/docs/native-interop/native-ux-components) to build native slider.

Here is the repo: [https://github.com/poul-kg/NativeSlider](https://github.com/poul-kg/NativeSlider)

I was able to see native slider in iOS.

Then I decided to change slider to MapKit map, and see if it will work.

Below is partial example, I’ve added just 2 lines which alloc/init UIView and MKMapView, and this was enough to break the build

```auto
[Require("Source.Include", "UIKit/UIKit.h")]
    [Require("Source.Include", "MapKit/MapKit.h")]
    extern(iOS) public class MySlider: LeafView, ISlider
    {
        [UXConstructor]
        public MySlider([UXParameter("Host")]ISliderHost host) : base(Create()) { }

        [Foreign(Language.ObjC)]
        static ObjC.Object Create()
        @{
            ::UISlider* slider = [[::UISlider alloc] init];
            [slider setMinimumValue: 0.0f];
            [slider setMaximumValue: 100.0f];

            // I've added these 2 lines, and it breaks my build. Why?
            UIView *mvc = [[UIView alloc] init];
            MKMapView* mv = [[MKMapView alloc] init];

            // return
            return slider;
        @}

```

**Error Message**

 ![file](https://s3.us-east-2.amazonaws.com/fuse-legacy-forum-assets/VFjuhqezQCBY-image-1500717482637.png)

---

<div class="post-metadata">

**Author:** ![poul.kg](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/poul.kg/32/585_2.png) [@poul.kg](https://forums.fusetools.com/u/poul.kg)\
**Post date:** [July 22, 2017, 11:34am UTC](https://forums.fusetools.com/t/error-objc-class-mkmapview-referenced-from/2682/2 "2017-07-22T11:34:15Z")

</div>

For now fixed by following first answer on StackOverflow: [https://stackoverflow.com/questions/19585317/when-added-mapkit-mapkit-h-getting-error-undefined-symbols-for-architecture-i](https://stackoverflow.com/questions/19585317/when-added-mapkit-mapkit-h-getting-error-undefined-symbols-for-architecture-i)

I wonder if there are any better way of adding required framework rather than doing it manually via XCode?

---

<div class="post-metadata">

**Author:** ![Baggers](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/baggers/32/665_2.png) [@Baggers](https://forums.fusetools.com/u/Baggers)\
**Post date:** [July 24, 2017, 8:31am UTC](https://forums.fusetools.com/t/error-objc-class-mkmapview-referenced-from/2682/3 "2017-07-24T08:31:55Z")

</div>

Hi Poul,

Sounds like `[Require("Xcode.Framework", "yourframeworkname.framework")]` would help here. Check out [https://www.fusetools.com/docs/native-interop/build-settings#xcode-settings](https://www.fusetools.com/docs/native-interop/build-settings#xcode-settings) for some info on this and other useful attributes.

---

<div class="post-metadata">

**Author:** ![poul.kg](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/poul.kg/32/585_2.png) [@poul.kg](https://forums.fusetools.com/u/poul.kg)\
**Post date:** [July 25, 2017, 7:10am UTC](https://forums.fusetools.com/t/error-objc-class-mkmapview-referenced-from/2682/4 "2017-07-25T07:10:48Z")

</div>

Thanks Chris,

I solved missing CoreLocation.framework by adding `"Fuse.GeoLocation"` to my `.unoproj` file.  
now CoreLocation is available.

but this doesn’t work with `[extern(iOS) Require("Xcode.EmbeddedFramework", "@('iOS/frameworks/Mapbox.framework':Path)")]`

- I see `Mapbox.framework` in Xcode in Embedded Frameworks section but I can not build my project without above error. So I add framework manually every time.

I need to manually add `Mapbox.framework` and select options below:

 ![file](https://s3.us-east-2.amazonaws.com/fuse-legacy-forum-assets/JA0MuGqWX4Wt-image-1500966619744.png)

repo is here: [https://github.com/poul-kg/NativeSlider/tree/map-box](https://github.com/poul-kg/NativeSlider/tree/map-box)

---

<div class="post-metadata">

**Author:** ![Baggers](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/baggers/32/665_2.png) [@Baggers](https://forums.fusetools.com/u/Baggers)\
**Post date:** [July 26, 2017, 12:23pm UTC](https://forums.fusetools.com/t/error-objc-class-mkmapview-referenced-from/2682/5 "2017-07-26T12:23:59Z")

</div>

To be honest, given that mapbox is in cocoapods, I’d probably just use that.  
You can add a cocoapod dependency to your project with an attribute.

```auto
[Require("Cocoapods.Podfile.Target", "pod 'RMStore', '~> 0.7'")]

```

So for mapbox this should do the job:

```auto
[Require("Cocoapods.Podfile.Target", "pod 'Mapbox-iOS-SDK'")]

```

Of course you will need to [install cocoapods](https://cocoapods.org/) first and then build your Fuse project with cocoapod support `fuse build -tiOS -DCOCOAPODS` (do an `uno clean` first)

Your first build with cocoapods will be super slow, as in maybe 15 minutes slow, this is cocoapods not fuse. After that the builds will be back to the usual speed.

I hope this helps
