# 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:** 15
**Page:** 3

<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, 3:09pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/42 "2021-01-30T15:09:31Z")

</div>

Fixed:

```auto
                     Reference 'Library' already was resolved to '/Users/mh/Library/Application Support/RemObjects Software/EBuild/Obj/Library-D92432DECFDFE00C048CE3108A8358F331DC0DEA/Debug/Island.Darwin.iOS/Device/arm64/Library.fx' for target 'Toffee-iOS'.
                     Reference 'Library' was resolved to '/Users/mh/Library/Application Support/RemObjects Software/EBuild/Obj/Library-D92432DECFDFE00C048CE3108A8358F331DC0DEA/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-arm64).

```

now to step two, why it doesn’t build the Library for Sim…

---

<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, 3:23pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/43 "2021-01-30T15:23:05Z")

</div>

Also fixed. Was caused by the differing project type, Toffee vs Island, that the Simulator=True (and other settings) didn’t migrate).

New build started now w/ both fixes

---

<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, 6:23pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/44 "2021-01-30T18:23:35Z")

</div>

Thanks very much

Would 20210130-153207-elements-develop have the fixes ?

---

<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, 6:40pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/45 "2021-01-30T18:40:16Z")

</div>

Yes.

---

<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 31, 2021, 3:20am UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/46 "2021-01-31T03:20:41Z")

</div>

That build didn’t seem to fix anything. If you click on the commit it lists no changes. Should your changes be listed ? I pulled the latest from the ebuild repo and built that. Copying the bin folder into my element folder, fixes the 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 31, 2021, 3:56am UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/47 "2021-01-31T03:56:25Z")

</div>

> [@mh](#):
>
> –debug --debug-reference-resolving

I have another project which doesnt build, can you see anything from the log ?

[Untitled-3.zip](https://talk.remobjects.com/uploads/short-url/Ap8SXqDgKsDjEU73glHy70EwEhp.zip) (72.7 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 31, 2021, 2:23pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/48 "2021-01-31T14:23:08Z")

</div>

> [@JohnMoshakis](#):
>
> That build didn’t seem to fix anything. If you click on the commit it lists no changes. Should your changes be listed ? I pulled the latest from the ebuild repo and built that. Copying the bin folder into my element folder, fixes the issue.

My apologies; I had to run out right after committing the fix, and it seems the push for my merge didn’t go thru :(. A new build is started now that does have the fix.

---

<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 31, 2021, 2:24pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/49 "2021-01-31T14:24:36Z")

</div>

> [@JohnMoshakis](#):
>
> I have another project which doesnt build, can you see anything from the log ?
> 
> [Untitled-3.zip](https://talk.remobjects.com/uploads/short-url/Ap8SXqDgKsDjEU73glHy70EwEhp.zip) (72.7 KB)

Not offhand. let me know if this one persists with the new build, and I’ll have a look tomorrow (or later today), if it does.

---

<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 31, 2021, 5:40pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/50 "2021-01-31T17:40:58Z")

</div>

Thanks. Tomorrow is fine, it is the weekend after all.

[MultiTargets.zip](https://talk.remobjects.com/uploads/short-url/id4VmlnEOys9cIqb63pmm6nhUfl.zip) (5.3 MB)

Im wondering if what I’ve done is a problem.

I added a second library called BaseLibrary. BaseLibrary is referenced by Library but also the two exes.

In the exe I have remote references but in Library it’s a project reference.

If the remote reference Library.element is the elements file, what does it do when it finds

```
    <ProjectReference Include="BaseLibrary">
      <Project>{B7CC504C-03B1-4DD2-9869-532E83E45BB4}</Project>
      <ProjectFile>..\BaseLibrary\BaseLibrary.elements</ProjectFile>
      <Private>True</Private>
    </ProjectReference>

```

---

<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: [February 1, 2021, 11:54am UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/51 "2021-02-01T11:54:04Z")

</div>

> [@JohnMoshakis](#):
>
> I added a second library called BaseLibrary. BaseLibrary is referenced by Library but also the two exes.
> 
> In the exe I have remote references but in Library it’s a project reference.

I would not be surprised if there’s a problems with mixing local and Remote Project References to the same project, within a solution. But if that’s the case, can we explore that with a simpler test case that does not also involve multi-target?

That said, looking at your project, BaseLibrary was missing form the .sln, so it failed on that. if I add it, I get:

```auto
E: Remote project 'github.com/Mosh/MultiTargets/BaseLibrary/BaseLibrary.elements:*' referenced from 'NotV1App' is already part of the solution as a different file.

```

which is what I recalled shoudkl happen (ie “dont do that”).

---

<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: [February 1, 2021, 1:55pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/52 "2021-02-01T13:55:32Z")

</div>

The solution V1App/V1App.sln has BaseLibrary as a remote reference, which one did you open ?

The solution Im using to build the libraries just has a project reference to BaseLibrary.

I’ll tidy up the solutions, and upload another zip.

---

<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: [February 1, 2021, 2:11pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/53 "2021-02-01T14:11:14Z")

</div>

[MultiTargets.zip](https://talk.remobjects.com/uploads/short-url/wt8PgMaKRQuF41oPIdHmoZUgJqN.zip) (5.3 MB)

So I have 2 solutions. Apps, which has everything as remote references and Libraries which has Library and BaseLibrary. Library has a ProjectReference to BaseLibrary.

I was just wonder if this was the issue.

When I build Apps I get 2 Project Reference BaseLibrary could not be resolved for Target.

Actually reading the error message would indicate it was the issue.

---

<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: [February 1, 2021, 3:47pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/54 "2021-02-01T15:47:44Z")

</div>

Interesting…

```auto
 Missing project 'BaseLibrary' referenced from 'Library', but project path '/Users/mh/Library/Application Support/RemObjects Software/EBuild/Packages/EBuild/github.com.Mosh.MultiTargets/BaseLibrary/BaseLibrary.elements' is valid.
   Package project 'github.com/Mosh/MultiTargets/Library/Library.elements:*' referenced from 'NotV1App', at '/Users/mh/Library/Application Support/RemObjects Software/EBuild/Packages/EBuild/github.com.Mosh.MultiTargets/Library/Library.elements'.
   Package project 'github.com/Mosh/MultiTargets/BaseLibrary/BaseLibrary.elements:*' referenced from 'NotV1App', at '/Users/mh/Library/Application Support/RemObjects Software/EBuild/Packages/EBuild/github.com.Mosh.MultiTargets/BaseLibrary/BaseLibrary.elements'.
   Package project 'github.com/Mosh/MultiTargets/Library/Library.elements:*' referenced from 'V1App', at '/Users/mh/Library/Application Support/RemObjects Software/EBuild/Packages/EBuild/github.com.Mosh.MultiTargets/Library/Library.elements'.
   Package project 'github.com/Mosh/MultiTargets/BaseLibrary/BaseLibrary.elements:*' referenced from 'V1App', at '/Users/mh/Library/Application Support/RemObjects Software/EBuild/Packages/EBuild/github.com.Mosh.MultiTargets/BaseLibrary/BaseLibrary.elements'.
   Build order:
   - 1. Library
   - 2. NotV1App
   - 3. V1App

```

its finding BaseLibrary ok, but it doesnt get added to the build order. I wonder why. will debug.

---

<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: [February 1, 2021, 4:11pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/55 "2021-02-01T16:11:04Z")

</div>

Fixed; was a chicken/egg problem:

as it went thru the references, first if found Library, that references BaseLibrary as a PROJECT reference (which at this point we don’t know about yet, so its “missing” from the sln), but since it finds the project via filename, it added it (but projects not part of the solution like that don’t get built, by default\*; only pre-existing output of it would be used to resolve it).

THEN it got to the BaseLibrary ref, found "hey, I already have this project in the solution, lets keep using that one), done. But ofc BaseLibrary was still disableed.

\*) workaround: `--build-missing-projects` will force all project references that can be resolved to a project file to be built, even if they weren’t;'t in the .sln

---

<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: [February 1, 2021, 7:39pm UTC](https://talk.remobjects.com/t/could-not-resolve-reference-realm-for-target-toffee-ios-uikit-for-mac/23960/56 "2021-02-01T19:39:24Z")

</div>

Thanks. I think it’s fixed now.

Im converting a more complex iOS example and thats building now.

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