# Failed with exception value cannot be null

**URL:** https://talk.remobjects.com/t/failed-with-exception-value-cannot-be-null/27318
**Category:** EBuild
**Created:** [October 6, 2022, 1:16am UTC](https://talk.remobjects.com/t/failed-with-exception-value-cannot-be-null/27318 "2022-10-06T01:16:14Z")
**Posts on this page:** 5
**Page:** 1

<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: [October 6, 2022, 1:16am UTC](https://talk.remobjects.com/t/failed-with-exception-value-cannot-be-null/27318/1 "2022-10-06T01:16:14Z")

</div>

Hi,  
One of my multi target libraries is now failing with this

```auto
                    -> Task RemObjects.EBuild.Elements.ElementsResolveToffeeReferencesForTarget started for Moshine.Api.Weather, Toffee.iOS.
                     Reference 'Foundation' was resolved to '/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/SDKs/Island/Darwin/iOS 16.0/Foundation.fx' for target 'Toffee.iOS'.
                     Reference 'Foundation' was resolved to '/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/SDKs/Island/Darwin/iOS 16.0/Foundation.fx' for target 'Toffee.iOS' (Device).
                     Reference 'Foundation' was resolved to '/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/SDKs/Island/Darwin/iOS 16.0 Simulator/Foundation.fx' for target 'Toffee.iOS' (Simulator).
                     Added implicit reference to '/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/SDKs/Island/Darwin/iOS 16.0/Foundation.fx'
                     Reference 'UIKit' was resolved to '/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/SDKs/Island/Darwin/iOS 16.0/UIKit.fx' for target 'Toffee.iOS'.
                     Reference 'UIKit' was resolved to '/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/SDKs/Island/Darwin/iOS 16.0/UIKit.fx' for target 'Toffee.iOS' (Device).
                     Reference 'UIKit' was resolved to '/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/SDKs/Island/Darwin/iOS 16.0 Simulator/UIKit.fx' for target 'Toffee.iOS' (Simulator).
                     Added implicit reference to '/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/SDKs/Island/Darwin/iOS 16.0/UIKit.fx'
                     Reference 'libToffee' was resolved to '/Users/JohnMoshakis/Documents/Elements/References/Toffee/iOS/libToffee.fx' via XML for target 'Toffee.iOS'.
                     Reference 'libToffee' was resolved to '/Users/JohnMoshakis/Documents/Elements/References/Toffee/iOS/libToffee.fx' for target 'Toffee.iOS' (Device).
                     Reference 'libToffee' was resolved to '/Users/JohnMoshakis/Documents/Elements/References/Toffee/iOS Simulator/libToffee.fx' for target 'Toffee.iOS' (Simulator).
                     Added implicit reference to '/Users/JohnMoshakis/Documents/Elements/References/Toffee/iOS/libToffee.fx'
                     Project 'Moshine.Foundation' referenced from 'Moshine.Api.Weather' is not enabled, reusing cached output.
D: Project Reference 'Moshine.Foundation' will resolve using target 'Toffee.iOS'.
                     Project Reference 'Moshine.Foundation' was resolved to '/Users/JohnMoshakis/Documents/Elements/References/Toffee/iOS/libElements.fx' via target 'Toffee.iOS' (but is already referenced).
E: Value cannot be null.
Parameter name: aFileName
D: | at RemObjects.Elements.RTL.Path.GetFileName (System.String aFileName) [0x00003] in <1f96089c4d1e43c8b828eaaae4f15d51>:0 .
D: | at RemObjects.EBuild.Elements.ElementsResolveToffeeReferencesForTarget.AdjustReferenceIfNeeded (RemObjects.EBuild.EBuildObject aReference) [0x00186] in <b6bde7d939804b83910b3aa6cc34d27d>:0 .
D: | at RemObjects.EBuild.Elements.ElementsResolveReferencesForTarget.ProcessProjectReference ____ToProject__ WithMatchingTarget__Cirrus (RemObjects.EBuild.EBuildObject aReference, RemObjects.EBuild.EBuildProject aProject, RemObjects.EBuild.EBuildTarget aTarget, System.Boolean aCirrus) [0x00453] in <b6bde7d939804b83910b3aa6cc34d27d>:0 .
D: | at RemObjects.EBuild.Elements.ElementsResolveReferencesForTarget.ProcessProjectReference ____ToProject__ WithMatchingTarget (RemObjects.EBuild.EBuildObject aReference, RemObjects.EBuild.EBuildProject aProject, RemObjects.EBuild.EBuildTarget aTarget) [0x00000] in <b6bde7d939804b83910b3aa6cc34d27d>:0 .
D: | at RemObjects.EBuild.Elements.ElementsResolveToffeeReferencesForTarget.ProcessProjectReference ____ToProject__ WithMatchingTarget (RemObjects.EBuild.EBuildObject aReference, RemObjects.EBuild.EBuildProject aProject, RemObjects.EBuild.EBuildTarget aTarget) [0x00239] in <b6bde7d939804b83910b3aa6cc34d27d>:0 .
D: | at RemObjects.EBuild.Elements.ElementsResolveReferencesForTarget.ProcessProjectReference ____ToProject__ WithTarget (RemObjects.EBuild.EBuildObject aReference, RemObjects.EBuild.EBuildProject aProject, RemObjects.EBuild.EBuildTarget aTarget) [0x00033] in <b6bde7d939804b83910b3aa6cc34d27d>:0 .
D: | at RemObjects.EBuild.Elements.ElementsResolveReferencesForTarget.ProcessProjectReferences () [0x00a3a] in <b6bde7d939804b83910b3aa6cc34d27d>:0 .
D: | at RemObjects.EBuild.Elements.ElementsResolveReferencesForTarget.Execute () [0x0001c] in <b6bde7d939804b83910b3aa6cc34d27d>:0 .
D: | at RemObjects.EBuild.EBuildContext.RunTask ________ forTarget (RemObjects.EBuild.EBuildTask+MetaClass aTask, RemObjects.EBuild.EBuildValues aSettings, RemObjects.EBuild.EBuildObjects aObjects, RemObjects.EBuild.EBuildTarget aTarget) [0x003b0] in <8432fbfcac84477d887551dbbbd1c409>:0 .
                  <- Task RemObjects.EBuild.Elements.ElementsResolveToffeeReferencesForTarget failed with exception Value cannot be null.

```

Any idea where I should start looking ?

Cheers,  
John

---

<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: [October 9, 2022, 1:23am UTC](https://talk.remobjects.com/t/failed-with-exception-value-cannot-be-null/27318/2 "2022-10-09T01:23:18Z")

</div>

[MultiTargetLibrary.zip](https://talk.remobjects.com/uploads/short-url/a5BaYiFjxqrvo8gOLTNziNpbK2q.zip) (194.0 KB)

This project highlights the issue. I have a multi target library with one target and it references my remote project.

```auto
  <ItemGroup>
    <Reference Include="#" />
    <Reference Include="Elements">
      <Private>True</Private>
    </Reference>
    <RemoteProjectReference Include="github.com/Mosh/Moshine.Foundation/Moshine.Foundation.elements:*">
      <Private>True</Private>
    </RemoteProjectReference>
  </ItemGroup>

```

If I delete the elements reference then it builds without the error. Also while the remote project reference is present it says it cant resolve the reference to elements.

Cheers,  
John

---

<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: [October 13, 2022, 12:38pm UTC](https://talk.remobjects.com/t/failed-with-exception-value-cannot-be-null/27318/3 "2022-10-13T12:38:28Z")

</div>

Could this one be looked into ?

---

<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: [October 13, 2022, 4:04pm UTC](https://talk.remobjects.com/t/failed-with-exception-value-cannot-be-null/27318/4 "2022-10-13T16:04:46Z")

</div>

It will be, yes.

---

<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: [October 13, 2022, 4:51pm UTC](https://talk.remobjects.com/t/failed-with-exception-value-cannot-be-null/27318/5 "2022-10-13T16:51:46Z")

</div>

Fixed, was a bad side effect from the fix for bugs://E26003: _No path for Reference when switching between device and simulator_
