# Could not resolve reference 'Realm' for target 'Toffee.iOS' (UIKit for Mac)

**URL:** https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960
**Category:** EBuild
**Created:** [January 16, 2021, 10:54pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960 "2021-01-16T22:54:57Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [January 20, 2021, 2:22pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/22 "2021-01-20T14:22:05Z")

</div>

Strange. I dont get an issue with realm, its referenced from services

These are the issues I get

E: Could not resolve reference ‘Moshine.Api.Location’ for target ‘Island.Darwin.watchOS’ (Simulator-x86\_64).

Is it because Im running on an intel mac ?

 ![Screen Shot 2021-01-20 at 9.20.21 AM](https://talk.remobjects.com/uploads/default/original/2X/d/d299494c2361c7455d23d867d73a28996935471b.jpeg)

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [January 20, 2021, 3:07pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/23 "2021-01-20T15:07:42Z")

</div>

> [@JohnMoshakis](#):
>
> Strange. I dont get an issue with realm, its referenced from services

You would get it, if you got past the other errors 😉

> [@JohnMoshakis](#):
>
> E: Could not resolve reference ‘Moshine.Api.Location’ for target ‘Island.Darwin.watchOS’ (Simulator-x86\_64).

Island? I thought we’re talking about Toffee now? the Island issue I fixed yesterday, as you recall? Do you have a new build?

---

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [January 20, 2021, 6:04pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/24 "2021-01-20T18:04:39Z")

</div>

Sorry I didn’t realize it was fixed in a new build.

I tried that and it fixes both issues.

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [January 20, 2021, 6:45pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/25 "2021-01-20T18:45:58Z")

</div>

> [@JohnMoshakis](#):
>
> Sorry I didn’t realize it was fixed in a new build.

hmm, but this second half of the thread has been specifically ab out _just that_:?

> [@mh](#):
>
> > [@mh](#):
> >
> > Fixed; the problem was Moshine.Api.Location was only built for device, but Island resolve (unlike Toffee) enforced that the reference was resolved for _all_ build destinations (ie Simulator, too).
> 
> > [@JohnMoshakis](#):
> >
> > I was also having a problem using the reference in a Toffee iOS app when build for the simulator. Would that fix also apply for this situation ?
> 
> No, this bug was Island-speicifc; toffee already had the check in place to only enforce the reference is resolved for all _enabled_ build destination… Do you have a repro for there Toffee issue?

---

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [January 20, 2021, 8:15pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/26 "2021-01-20T20:15:44Z")

</div>

Yes. It seemed like it was related but I wasn’t sure, so I also wasn’t sure if I should create a separate post for it.

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [January 20, 2021, 8:22pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/27 "2021-01-20T20:22:16Z")

</div>

> [@JohnMoshakis](#):
>
> Yes. It seemed like it was related but I wasn’t sure, so I also wasn’t sure if I should create a separate post for it.

Yes, but this one was exactly the very issue I fixed before!

---

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [January 29, 2021, 1:27am UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/28 "2021-01-29T01:27:09Z")

</div>

I don’t think its totally fixed.

I have 2 projects useToffeev1 is true in one but false in the other.

If I do a rebuild all, NotV1App, the one where UseToffeev1 is false fails with

`E: Could not resolve reference 'Library' for target 'Toffee-iOS' (Simulator-x86_64).`  
[MultiTargets.zip](https://talk.remobjects.com/uploads/short-url/13yaSm5E6JfWvz1e5IwwuhRYlTj.zip) (1.8 MB)  
Cheers,  
John

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [January 29, 2021, 12:31pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/29 "2021-01-29T12:31:34Z")

</div>

Hm, after fixing the Provisioning Profile, both project build w/o errors for me… both incremental, and Clean/Rebuils (which builds all build destinations). what am I missing?

---

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [January 29, 2021, 4:20pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/30 "2021-01-29T16:20:18Z")

</div>

Is it because Im running on intel ?

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [January 29, 2021, 4:26pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/31 "2021-01-29T16:26:27Z")

</div>

> [@JohnMoshakis](#):
>
> Is it because Im running on intel ?

I dont see how that could possibly make a difference. Did you try a Clean & Rebuild, jic.

---

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [January 29, 2021, 4:41pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/32 "2021-01-29T16:41:22Z")

</div>

Yes I have done a clean and rebuild

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [January 29, 2021, 4:48pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/33 "2021-01-29T16:48:50Z")

</div>

Can you run

`ebuild --debug --debug-reference-resolving --rebuild > log.txt`

in the folder with the solution, and send me the full; output?

here’s mine, if you wanna compare yourself.

[log.txt](https://talk.remobjects.com/uploads/short-url/gbmjAOFD1Mrn2QfiG7bY9zeKYCB.txt) (364.6 KB)

---

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [January 29, 2021, 6:27pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/34 "2021-01-29T18:27:35Z")

</div>

> [@mh](#):
>
> ebuild --debug --debug-reference-resolving --rebuild \> log.txt

They both build successfully using that command line.[log.txt.zip](https://talk.remobjects.com/uploads/short-url/ol98C3RCsz5XC6a18VgPRKKOXAu.zip) (21.6 KB)

I can only see architecture differences.

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [January 29, 2021, 7:55pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/35 "2021-01-29T19:55:51Z")

</div>

> [@JohnMoshakis](#):
>
> They both build successfully using that command line

but not in Fire? sure yu;'re using the latest compiler inside Fire? can you send me the log of a Rebuild in Fire too? if it still fails, add `--debug --debug-reference-resolving` in Project|Settings|Show Solution Settings (doing forget to remove it later) and Rebuild again. send me with logs, and I’ll compare tomorrow.

---

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [January 29, 2021, 7:59pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/36 "2021-01-29T19:59:25Z")

</div>

I was using the 2597 command line tools from Fire. I downloaded 2599 and Im just reimporting the 14.4 sdk so I’ll try again after thats finished.

---

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [January 30, 2021, 2:11am UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/37 "2021-01-30T02:11:19Z")

</div>

[Untitled-2.zip](https://talk.remobjects.com/uploads/short-url/r2rqyKYjbzMBrlbsHEuO09qdpcG.zip) (15.0 KB)

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [January 30, 2021, 2:31pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/38 "2021-01-30T14:31:59Z")

</div>

Curious:

```auto
                  -> Task RemObjects.EBuild.Elements.ElementsResolveIslandReferencesForTarget started for NotV1App, Toffee-iOS.
D: Project Reference 'Library' will resolve using target 'Island.Darwin.iOS'.
                     Project Reference 'Library' was resolved to '/Users/JohnMoshakis/Documents/Elements/References/Island/iOS/arm64/Elements.fx' via target 'Island.Darwin.iOS' (but is already referenced).
                     Project Reference 'Library' was resolved to '/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/Library-2F260B77D81AA4BE3CB1615F592ABDB2A3F0B7DF/Debug/Island.Darwin.iOS/Device/arm64/Library.fx' via target 'Island.Darwin.iOS'.
                     Reference 'Library' was resolved to '/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/Library-2F260B77D81AA4BE3CB1615F592ABDB2A3F0B7DF/Debug/Island.Darwin.iOS/Device/arm64/Library.fx' for target 'Toffee-iOS' (Device-arm64).
E: Could not resolve reference 'Library' for target 'Toffee-iOS' (Simulator-x86_64).

```

vs

```auto
D: Project Reference 'Library' will resolve using target 'Island.Darwin.iOS'.
                     Project Reference 'Library' was resolved to '/Users/mh/Code/Elements/Bin/References/Island/iOS/arm64/Elements.fx' via target 'Island.Darwin.iOS' (but is already referenced).
                     Project Reference 'Library' was resolved to '/Users/mh/Library/Application Support/RemObjects Software/EBuild/Obj/Library-D92432DECFDFE00C048CE3108A8358F331DC0DEA/Release/Island.Darwin.iOS/Device/arm64/Library.fx' via target 'Island.Darwin.iOS'.
                     Reference 'Library' was resolved to '/Users/mh/Library/Application Support/RemObjects Software/EBuild/Obj/Library-D92432DECFDFE00C048CE3108A8358F331DC0DEA/Release/Island.Darwin.iOS/Device/arm64/Library.fx' for target 'Toffee-iOS' (Device-arm64).
                     Reference 'Library' was resolved to '/Users/mh/Library/Application Support/RemObjects Software/EBuild/Obj/Library-D92432DECFDFE00C048CE3108A8358F331DC0DEA/Release/Island.Darwin.iOS/Device/arm64/Library.fx' for target 'Toffee-iOS' (Simulator-arm64).

```

what;'s in

`/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/Library-2F260B77D81AA4BE3CB1615F592ABDB2A3F0B7DF/Debug/Toffee.iOS/`

just `Device/arm64/Library.fx`, or also Simulator/…?

```auto
               Final Output for Referencing:
                 Elements (/Users/JohnMoshakis/Documents/Elements/References/Island/macOS/x86_64/Elements.fx), Island.Darwin.macOS
                 Elements (/Users/JohnMoshakis/Documents/Elements/References/Island/iOS/arm64/Elements.fx), Island.Darwin.iOS
                 Elements (/Users/JohnMoshakis/Documents/Elements/References/Island/tvOS/arm64/Elements.fx), Island.Darwin.tvOS
                 Elements (/Users/JohnMoshakis/Documents/Elements/References/Island/watchOS/arm64_32/Elements.fx), Island.Darwin.watchOS
                 libLibrary (/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/Library-2F260B77D81AA4BE3CB1615F592ABDB2A3F0B7DF/Debug/Toffee.iOS/Device/libLibrary.fx), Toffee.iOS
                 libLibrary (/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/Library-2F260B77D81AA4BE3CB1615F592ABDB2A3F0B7DF/Debug/Toffee.macOS/Device/libLibrary.fx), Toffee.macOS
                 libLibrary (/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/Library-2F260B77D81AA4BE3CB1615F592ABDB2A3F0B7DF/Debug/Toffee.tvOS/Device/libLibrary.fx), Toffee.tvOS
                 libLibrary (/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/Library-2F260B77D81AA4BE3CB1615F592ABDB2A3F0B7DF/Debug/Toffee.watchOS/Device/libLibrary.fx), Toffee.watchOS
                 Library (/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/Library-2F260B77D81AA4BE3CB1615F592ABDB2A3F0B7DF/Debug/Island.Darwin.macOS/Device/x86_64/Library.fx), Island.Darwin.macOS
                 Library (/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/Library-2F260B77D81AA4BE3CB1615F592ABDB2A3F0B7DF/Debug/Island.Darwin.iOS/Device/arm64/Library.fx), Island.Darwin.iOS
                 Library (/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/Library-2F260B77D81AA4BE3CB1615F592ABDB2A3F0B7DF/Debug/Island.Darwin.tvOS/Device/arm64/Library.fx), Island.Darwin.tvOS
                 Library (/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/Library-2F260B77D81AA4BE3CB1615F592ABDB2A3F0B7DF/Debug/Island.Darwin.watchOS/Device/arm64_32/Library.fx), Island.Darwin.watchOS
            <- Task RemObjects.EBuild.Elements.ElementsCopyFinalOutput finished for Library, took 0.0147s (19.241s).

```

it looks like Library is not built for Sim, just for Device, even though the command line has

–setting:3B71FB09-80B2-472F-B143-D8D8C07D4A7C,Simulator=True --setting:3B71FB09-80B2-472F-B143-D8D8C07D4A7C,Device=True

The same is true for MY log, but for some reason I do have have the Toffee\Simulator folder, so it still succeeds.

I think we have two issues coming together here.

(a) its not passing the right set of build destinations to the project reference (which I thought I had fixed last week?)

(b) because of that, the _Clean_ also doesn’t clean up my Simulator folder, hiding the bug.

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [January 30, 2021, 2:36pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/39 "2021-01-30T14:36:23Z")

</div>

Hmm, nope, thats not it. deleted Simulator, its back after I rebuild and gone after Clean.

So I can see no difference between your case where it succeeds, and my case where it doesn’t and it _does_ build Sim and Device correctly.

We’ll have to see whats in your `/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/Library-2F260B77D81AA4BE3CB1615F592ABDB2A3F0B7DF/Debug/Toffee.iOS/` folder to say more; does it have Sim (if so, why dormant it resolve?) or not (if so, why not).

But from your log it does like it builds Sim:

```auto
               Compiling target 'Toffee.iOS', Simulator
               -> Target Toffee.iOS started compiling for Simulator.
                  Starting compile for Library Toffee.iOS Simulator

```

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [January 30, 2021, 2:41pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/40 "2021-01-30T14:41:33Z")

</div>

Wait, all of this is a red herring. its Library/Darwin that matters, to Toffee. And that doesnt have Simulator built (why?) so it definitely _should fail_ to resolve (why doesn’t it here)?

I’ll have to delve into debugging this…

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [January 30, 2021, 2:45pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/41 "2021-01-30T14:45:14Z")

</div>

Actually, this isn the problem right here:

```auto
                     Reference 'Library' was resolved to '/Users/mh/Library/Application Support/RemObjects Software/EBuild/Obj/Library-D92432DECFDFE00C048CE3108A8358F331DC0DEA/Release/Island.Darwin.iOS/Device/arm64/Library.fx' for target 'Toffee-iOS' (Device-arm64).
                     Reference 'Library' was resolved to '/Users/mh/Library/Application Support/RemObjects Software/EBuild/Obj/Library-D92432DECFDFE00C048CE3108A8358F331DC0DEA/Release/Island.Darwin.iOS/Device/arm64/Library.fx' for target 'Toffee-iOS' (Simulator-arm64).

```

it SOMEHOW resolves the Device version for Simulator, too.

My gut feelingL this actually _is_ because I’m on an Arm Mac and you’re not, and thus the architecture for Divide and Sim is the same, and it just goes “ah, arm64, close enough”. Investigating/fixing that part now.

[Previous page](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960.md?page=1)

[Next page](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960.md?page=3)
