# Impossible to build for devices

**URL:** <https://forums.fusetools.com/t/impossible-to-build-for-devices/5895>\
**Category:** Bug Reports\
**Created:** [March 7, 2016, 3:13am UTC](https://forums.fusetools.com/t/impossible-to-build-for-devices/5895 "2016-03-07T03:13:55Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![cyril.gantzer](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@cyril.gantzer](https://forums.fusetools.com/u/cyril.gantzer)\
**Post date:** [March 7, 2016, 3:13am UTC](https://forums.fusetools.com/t/impossible-to-build-for-devices/5895/1 "2016-03-07T03:13:55Z")

</div>

I have just downloaded the latest version of fuse, and XCode. I can build apps for Local without any issue, but if I try to `fuse build --target=iOS --run` or `fuse build --target=Android --run` then all I get is two dozens of: `../../../../../usr/local/share/uno/Packages/UnoCore/0.24.5/Targets/CPlusPlus/iOS/$.uxl(41,16): E0000: An exception was thrown by the type initializer for System.Drawing.GDIPlus`

And a `FATAL ERROR: Build failed.` in the end. I really have no idea where to start investigating this. Even if I download an example for [fusetools.com](http://fusetools.com), I just cannot build it.

---

<div class="post-metadata">

**Author:** ![Emil\_Sandsto](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/emil_sandsto/32/523_2.png) [@Emil\_Sandsto](https://forums.fusetools.com/u/Emil_Sandsto)\
**Post date:** [March 7, 2016, 2:16pm UTC](https://forums.fusetools.com/t/impossible-to-build-for-devices/5895/2 "2016-03-07T14:16:13Z")

</div>

Hi,

I would need some more info about your system, to be able to help you.

So which version of OS X are you running? I would also like to see the results of running the following commands `otool -L /usr/lib/libbz2.1.0.dylib` and `otool -L /usr/lib/libiconv.2.dylib` from terminal.

---

<div class="post-metadata">

**Author:** ![cyril.gantzer](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@cyril.gantzer](https://forums.fusetools.com/u/cyril.gantzer)\
**Post date:** [March 7, 2016, 4:26pm UTC](https://forums.fusetools.com/t/impossible-to-build-for-devices/5895/3 "2016-03-07T16:26:21Z")

</div>

Hi Emil, thanks for the reply (and for Fuse)

I’m running El Capitan 10.11.3, fully updated (but not the beta version).

`otool -L /usr/lib/libbz2.1.0.dylib`:

```auto
/usr/lib/libbz2.1.0.dylib (compatibility version 1.0.0, current version 1.0.5)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1225.0.0)

```

`otool -L /usr/lib/libiconv.2.dylib`:

```auto
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1225.0.0)

```

Edit: maybe worth mentioning that I am able to build the project with XCode

---

<div class="post-metadata">

**Author:** ![Emil\_Sandsto](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/emil_sandsto/32/523_2.png) [@Emil\_Sandsto](https://forums.fusetools.com/u/Emil_Sandsto)\
**Post date:** [March 7, 2016, 10:18pm UTC](https://forums.fusetools.com/t/impossible-to-build-for-devices/5895/4 "2016-03-07T22:18:57Z")

</div>

This have been reported once before, however I have been unable to pinpoint why it happens (it doesn’t happen in a clean VM).

Could you try to run `export MONO_LOG_LEVEL=debug` and in the same terminal instance run `fuse build --target=iOS --run`. Then upload the output to our private dropbox: [https://www.dropbox.com/request/ZgndLtJQm5eGzG9cicGK](https://www.dropbox.com/request/ZgndLtJQm5eGzG9cicGK).

**Pro tip:** Pipe the build command to a file by `fuse build --target=iOS --run > log.txt`

---

<div class="post-metadata">

**Author:** ![cyril.gantzer](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@cyril.gantzer](https://forums.fusetools.com/u/cyril.gantzer)\
**Post date:** [March 7, 2016, 10:29pm UTC](https://forums.fusetools.com/t/impossible-to-build-for-devices/5895/5 "2016-03-07T22:29:00Z")

</div>

Done. I did a `--target=Android` because now that I’ve fiddled with XCode, `--target=iOS` gives me a different error (something with signed certs)

---

<div class="post-metadata">

**Author:** ![Emil\_Sandsto](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/emil_sandsto/32/523_2.png) [@Emil\_Sandsto](https://forums.fusetools.com/u/Emil_Sandsto)\
**Post date:** [March 7, 2016, 10:42pm UTC](https://forums.fusetools.com/t/impossible-to-build-for-devices/5895/6 "2016-03-07T22:42:44Z")

</div>

Thanks for the log! 🙂

So it looks like our bundled mono is missing a required dependency. I’ll will fix that, however a temporary solution, is to install: [http://download.mono-project.com/archive/4.0.4/macos-10-x86/MonoFramework-MDK-4.0.4.macos10.xamarin.x86.pkg](http://download.mono-project.com/archive/4.0.4/macos-10-x86/MonoFramework-MDK-4.0.4.macos10.xamarin.x86.pkg)

---

<div class="post-metadata">

**Author:** ![Emil\_Sandsto](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/emil_sandsto/32/523_2.png) [@Emil\_Sandsto](https://forums.fusetools.com/u/Emil_Sandsto)\
**Post date:** [March 7, 2016, 10:48pm UTC](https://forums.fusetools.com/t/impossible-to-build-for-devices/5895/7 "2016-03-07T22:48:51Z")

</div>

For your other problem, have you synced the neccessary certificates, that allows you to deploy iOS apps?

In that regard, some more information, would be helpful.

---

<div class="post-metadata">

**Author:** ![cyril.gantzer](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@cyril.gantzer](https://forums.fusetools.com/u/cyril.gantzer)\
**Post date:** [March 7, 2016, 10:52pm UTC](https://forums.fusetools.com/t/impossible-to-build-for-devices/5895/8 "2016-03-07T22:52:40Z")

</div>

I have not synced anything, I was under the impression that, for testing and preview purposes I didn’t need any signed certificate? I’m probably wrong in that regard, is there something Fuse-specific that I should do?

Thanks for the link to Mono!

---

<div class="post-metadata">

**Author:** ![Emil\_Sandsto](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/emil_sandsto/32/523_2.png) [@Emil\_Sandsto](https://forums.fusetools.com/u/Emil_Sandsto)\
**Post date:** [March 8, 2016, 9:30am UTC](https://forums.fusetools.com/t/impossible-to-build-for-devices/5895/9 "2016-03-08T09:30:05Z")

</div>

You need something called _provisioning profile_. This article here explains the steps required [http://codewithchris.com/deploy-your-app-on-an-iphone/](http://codewithchris.com/deploy-your-app-on-an-iphone/)

You should be able to deploy apps with Fuse to iOS, after that.

---

<div class="post-metadata">

**Author:** ![cyril.gantzer](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@cyril.gantzer](https://forums.fusetools.com/u/cyril.gantzer)\
**Post date:** [March 8, 2016, 7:09pm UTC](https://forums.fusetools.com/t/impossible-to-build-for-devices/5895/10 "2016-03-08T19:09:18Z")

</div>

Hm but I don’t even want to reach this step, I just want an on-device preivew. XCode will let me do that even without a dev account. Is it intended that Fuse _requires_ an Apple Dev account for preview on device?

---

<div class="post-metadata">

**Author:** ![Remi\_Pedersen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/remi_pedersen/32/432_2.png) [@Remi\_Pedersen](https://forums.fusetools.com/u/Remi_Pedersen)\
**Post date:** [March 9, 2016, 11:03am UTC](https://forums.fusetools.com/t/impossible-to-build-for-devices/5895/11 "2016-03-09T11:03:45Z")

</div>

Fuse exports the preview app to the device through Xcode, so we’re subject to whatever requirements xcode imposes for that.

However, it should now be possible to deploy (for testing purposes) using the free provisioning profile option that was included as of Xcode 7.

I believe this requires you to use a specific bundle identifier for your app, matching the one set for the provisioning profile. The bundle identifier for is by default defined by your Fuse project name but it can be set to anything you want through `iOS.BundleIdentifier` in the [project file.](https://www.fusetools.com/learn/uno#uno-project-format-overview)

As for otherwise setting up the free provisioning, [this](https://developer.apple.com/library/prerelease/ios/documentation/IDEs/Conceptual/AppDistributionGuide/LaunchingYourApponDevices/LaunchingYourApponDevices.html) and [this](http://stackoverflow.com/questions/30973799/ios-9-new-feature-free-provisioning-run-your-app-on-a-device-just-with-your-ap) seems like good starting points.

---

<div class="post-metadata">

**Author:** ![cyril.gantzer](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@cyril.gantzer](https://forums.fusetools.com/u/cyril.gantzer)\
**Post date:** [March 9, 2016, 9:55pm UTC](https://forums.fusetools.com/t/impossible-to-build-for-devices/5895/12 "2016-03-09T21:55:58Z")

</div>

Thanks _so_ much. What I had to do was to get the Bundle Identifier generated by XCode, put it in the .unoproj, and I could build for iOS. This problem is solved.

However (sorry :D) `fuse build` will install the app on device and then detach, and `fuse preview` will build a preview and open XCode. Is there a way to have the “live preview” on device? Like, I change the code in Sublime, hit Save, and the change is visible on the phone instantly. I thought I gatehred from the video that Fuse could do that, but I cannot replicate the behaviour.

Edit: fixed, solved, running. After `fuse preview` opens XCode, you must ask XCode to install the project on device, and it will actually install the Preview App, which has the live reload. Truly magical. Many thanks for the support!

---

<div class="post-metadata">

**Author:** ![Jake\_Taylor](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/jake_taylor/32/512_2.png) [@Jake\_Taylor](https://forums.fusetools.com/u/Jake_Taylor)\
**Post date:** [March 9, 2016, 10:09pm UTC](https://forums.fusetools.com/t/impossible-to-build-for-devices/5895/13 "2016-03-09T22:09:03Z")

</div>

yes, using preview will open xcode, but then if you build and deploy that app from xcode (cmd+R) you’ll get what you’re looking for 🙂
