Project reference could not be resolved

(JohnMoshakis) #1

Hi,
The other I noticed is that if you add a project import to a solution but dont actually build. The reference is always shown as "

could not be resolved"

The exclamation mark remains even if I build.

If I build the solution and then add the reference it shows up ok.

Cheers,
John

0 Likes

(JohnMoshakis) #2

Do you know why this appears ? In the latest one of my projects is showing a number of project references could not be resolved

I can click on reveal project in finder and its present. The project also builds fine for both simulator and device.

0 Likes

(JohnMoshakis) #3

I think its the hintpath. I re added the reference and it gets set again

0 Likes

(marc hoffman) #4

with nothing more to go on than this screenshot? nope.

0 Likes

(marc hoffman) #5

As for this one:

well. until you build the referenced project, it’s not there, so it literally cannot be resolved (yet), so that’s expected, no?

check the resolve log for details?

0 Likes

(JohnMoshakis) #6

The icon indicates if the fx file is present ? I do a clean and get this

55%20AM

If I do a simulator build then the “project references could not be resolved” remains. The build also fails but I cant see any errors.

I do get these warnings

                 Reference 'SystemConfiguration' was resolved to '/Applications/Fire.app/Contents/Resources/Toffee SDKs/iOS 12.2 Simulator/SystemConfiguration.fx' for target 'Toffee-iOS' (Simulator).

W: Reference ‘iRacedWatchOS’ contains no referenceable WatchKitApp binaries for target ‘Toffee-watchOS’
D: Project Reference ‘Realm’ will resolve using target ‘Toffee-iOS’.
Project Reference ‘Realm’ was resolved to ‘/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/Realm-08FC45A2795F8A5A995A8C80B28EB2CD24FD03B9/Unknown/Toffee-iOS/Simulator/Realm.fx’ via target ‘Toffee-iOS’.
W: Could not resolve reference ‘Realm’ for target ‘Toffee-iOS’ (Device).
Reference ‘Realm’ was resolved to ‘/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/Realm-08FC45A2795F8A5A995A8C80B28EB2CD24FD03B9/Unknown/Toffee-iOS/Simulator/Realm.fx’ for target ‘Toffee-iOS’ (Simulator).
D: Project Reference ‘PureLayout’ will resolve using target ‘Toffee-iOS’.
Project Reference ‘PureLayout’ was resolved to ‘/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/PureLayout-0782A00078DE2B4307E0BEB4AD1C02D4086EB757/Unknown/Toffee-iOS/Simulator/PureLayout.fx’ via target ‘Toffee-iOS’.
W: Could not resolve reference ‘PureLayout’ for target ‘Toffee-iOS’ (Device).
Reference ‘PureLayout’ was resolved to ‘/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/PureLayout-0782A00078DE2B4307E0BEB4AD1C02D4086EB757/Unknown/Toffee-iOS/Simulator/PureLayout.fx’ for target ‘Toffee-iOS’ (Simulator).
D: Project Reference ‘AppAuth’ will resolve using target ‘Toffee-iOS’.
Project Reference ‘AppAuth’ was resolved to ‘/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/AppAuth-EE4A06DA71D624ECF76A8EA36A3248E2E54C9451/Unknown/Toffee-iOS/Simulator/AppAuth.fx’ via target ‘Toffee-iOS’.
W: Could not resolve reference ‘AppAuth’ for target ‘Toffee-iOS’ (Device).
Reference ‘AppAuth’ was resolved to ‘/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/AppAuth-EE4A06DA71D624ECF76A8EA36A3248E2E54C9451/Unknown/Toffee-iOS/Simulator/AppAuth.fx’ for target ‘Toffee-iOS’ (Simulator).
<- Task RemObjects.EBuild.Elements.ElementsResolveToffeeReferencesForTarget failed for iRacediOS, Toffee-iOS, took 0.0447s (0.0448s).

If I then do a device build the project references are still unresolved. If I then switch back to simulator they are fixed.

0 Likes

(marc hoffman) #7

check. the resolve log. for details.

0 Likes

(JohnMoshakis) #8

Are exclamation marks errors ?

buildlog.txt (132.1 KB)
It seems like there is a dependency on a device build but Im just building for the simulator ?

0 Likes

(marc hoffman) #9

again please check the resolve log, it shows exactly what’s going on.

0 Likes

(marc hoffman) #10

Ok, so let’s break this down.

First, you need to distinguish between in-IDE resolve, which happens automatically on project load (and when needed) and build, which happens when you press “Build” or “Run”. The are completely separate processes, though both perform a reference resolve (and ideally, should succeed or fail in the same way).

The in-IDE resolve is what drives what yo see in the tree view. Essentially, the IDE goes thru the same steps as the build would to find the appropriate .dll/.jar/.fx files for your references, and it uses them to populate the in-IDE “compiler” that drives code completion & co.

Any reference for which the .dll/.jar/.fx file(s) cannot be found is considered a resolve failure, as essentially whatever types that reference is supposed to provide you won’t be available. As such, if you have a project reference, and the output of that project does not exist yet, that’s a failure, and you will see the yellow icon on the reference. After all, the IDE won’t be able to load that reference and add its types to CC, and the icon is there to (among other things) let you know why.

And yes, the same is true when you clean. The clean is deleting the .fx or .dll file for the project reference, so the reference is then “broken”, until you build again, and will show the error icon.

(the same logic applies to the build, except for the build, the missing project reference would of course be created in time, because the two projects would build in order (if enabled). In-IDE resolve does not do full builds, so of the reference isn’t there yet, it’s, well, not there.

As mentioned before, in-IDE resolve uses the same EBuild resolve task as the actual build uses, and it generates similar output you can look at to diagnose unexpected problems yourself. The output is very details and usually makes it clear what the problem is — but it needs to be looked at, of course.

You can see the resolve log by selecting the “References” node. You can also (new since ~2391), force a re-resolve by right-clicking the “References” node.

There’s four main differences between in-IDE resolve and the resolve phase during build:

(a) it runs separate for each project; not once for the entire solution. as a result, it is a bit less able to recover form bad/missing project references (but essentially, if the ProjectFile path is correct, it should be able to deal). The resolve log will e explicit about this.
(b) as mentioned before, it just runs the resolve (and tasks resolve depends on), but it doesn’t build anything.
(c ) It uses a separate “configuration”, so that the them “obj” data created as part of a resolve doesn’t conflict with that created by the build. That’s why in “obj” you’ll see Debug, Release and Fire folders.
(d) it uses the a native Cocos build of EBuild, while the actual build uses the .NET/Mono version in ebuild.exe. This generally should not make a difference, but s the root of the “file access” bug you saw a few weeks back, with the Carter reference.

One last note, there’s a small bug/oversight that I fixed yesterday that might affect what you see WRT project references, and that is after a (re)build, Fire did not automatically re-resolve references (as that was purely driven by file change notifications, and if the project reference was missing before, of course there was no file to monitor for changes). So after your first build, the yellow icon won’t go away on its own yet; until you re-resolve manually or reload the project. That’s fixed for next week.

Does that make sense?

0 Likes

(marc hoffman) #11

Attached is an iOS project with a project reference to a static library. once built for both targets (pro tip: rebuild will build for device and sim at once), The reference resolves fine (and to the correct version of there .fx), no matter what kind of target is selected.

What am I missing?

EmptyProject35.zip (123.0 KB)

   Missing dependent project 'StaticLibrary7' referenced from 'EmptyProject35', but project path '/Users/mh/Test Projects/EmptyProject35/StaticLibrary7/StaticLibrary7.elements' is valid.
   -> Task __RemObjects_EBuild_Elements_ElementsApplyLegacySettings started for EmptyProject35, Toffee-iOS.
      Mapping DefineConstants=DEBUG;TRACE; to ConditionalDefines
      Mapping AssemblyName=EmptyProject35 to BinaryName
   <- Task __RemObjects_EBuild_Elements_ElementsApplyLegacySettings finished for EmptyProject35, Toffee-iOS, took 0.0018s (0.0019s).
   -> Task __RemObjects_EBuild_Elements_ElementsSanityCheck started for EmptyProject35, Toffee-iOS.
   <- Task __RemObjects_EBuild_Elements_ElementsSanityCheck finished for EmptyProject35, Toffee-iOS, took 0.0000s (0.0001s).
   -> Task __RemObjects_EBuild_Elements_ElementsPreparePlatforms started for EmptyProject35.
      Preparing target 'Toffee-iOS' (platform 'Toffee').
D:    Target-specific Settings, before prepare
D:      - <BinaryName = EmptyProject35 [Target: Toffee-iOS]>
D:      - <ConditionalDefines = DEBUG;TRACE; [Target: Toffee-iOS]>
D:      - <ImpliedConditionalDefines = TOFFEEV1 [Target: Toffee-iOS]>
D:      - <Mode = Toffee [Target: Toffee-iOS]>
D:      - <ModeNameResolveOverride = ToffeeV1 [Target: Toffee-iOS]>
D:      - <SubMode = iOS [Target: Toffee-iOS]>
      -> Task __RemObjects_EBuild_Elements_ElementsDarwinGatherXcodeDetails started for EmptyProject35.
      <- Task __RemObjects_EBuild_Elements_ElementsDarwinGatherXcodeDetails finished for EmptyProject35, took 0.0000s (0.0001s).
      -> Task __RemObjects_EBuild_Elements_ElementsPreflightToffee started for EmptyProject35.
         Toffee SDK Folder found in '/Users/mh/Code/Fire/Bin/Build/macOS/Fire.app/Contents/Resources/Toffee SDKs'.
      <- Task __RemObjects_EBuild_Elements_ElementsPreflightToffee finished for EmptyProject35, took 0.0004s (0.0007s).
      -> Task PrepareToffeePlatform started for EmptyProject35, Toffee-iOS.
D:       Xcode developer folder is '/Users/mh/Applications/Xcode-10.2.app/Contents/Developer'
         Xcode Version is 10.2 (10E125), macOS Version is 10.14.4 (18E226).
D:       Supported iOS SDKs in local FXs:
D:       - iOS 12.2
D:       - iOS 12.1
D:       Supported iOS SDKs in Xcode 10.2:
D:       - iOS 12.2
         No exact iOS SDK version was specified for target 'Toffee-iOS', using 'iOS 12.2'.
      <- Task PrepareToffeePlatform finished for EmptyProject35, Toffee-iOS, took 0.1635s (0.1644s).
D:    Target-specific Settings, after prepare
D:      - <Architecture = arm64 [Target: Toffee-iOS]>
D:      - <Architecture-Device = arm64 [Target: Toffee-iOS]>
D:      - <Architecture-Simulator = x86_64 [Target: Toffee-iOS]>
D:      - <BinaryName = EmptyProject35 [Target: Toffee-iOS]>
D:      - <BuildOSBuild = 18E226 [Target: Toffee-iOS]>
D:      - <BuildOSVersion = 10.14.4 [Target: Toffee-iOS]>
D:      - <ConditionalDefines = DEBUG;TRACE; [Target: Toffee-iOS]>
D:      - <DeploymentTargetVersion = 12.2 [Target: Toffee-iOS]>
D:      - <FinalBinaryName = EmptyProject35 [Target: Toffee-iOS]>
D:      - <FinalOutputFolderSuffix-Simulator =  Simulator [Target: Toffee-iOS]>
D:      - <IDE:TargetInfo = iOS ; Xcode 10.2 (10E125) [Target: Toffee-iOS]>
D:      - <ImpliedConditionalDefines = TOFFEEV1 [Target: Toffee-iOS]>
D:      - <IntermedateFolderSuffix-Device = Device [Target: Toffee-iOS]>
D:      - <IntermedateFolderSuffix-Simulator = Simulator [Target: Toffee-iOS]>
D:      - <Mode = Toffee [Target: Toffee-iOS]>
D:      - <ModeNameResolveOverride = ToffeeV1 [Target: Toffee-iOS]>
D:      - <SDK = iOS 12.2 [Target: Toffee-iOS]>
D:      - <SDKFolder = /Users/mh/Code/Fire/Bin/Build/macOS/Fire.app/Contents/Resources/Toffee SDKs/iOS 12.2 [Target: Toffee-iOS]>
D:      - <SDKFolderInXcode-Simulator = /Users/mh/Applications/Xcode-10.2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk [Target: Toffee-iOS]>
D:      - <SDKName = iOS [Target: Toffee-iOS]>
D:      - <SDKNameInXcode-Device = iPhoneOS [Target: Toffee-iOS]>
D:      - <SDKNameInXcode-Simulator = iPhoneSimulator [Target: Toffee-iOS]>
D:      - <SDKVersion = 12.2 [Target: Toffee-iOS]>
D:      - <SimulatorArchitecture = x86_64 [Target: Toffee-iOS]>
D:      - <SubMode = iOS [Target: Toffee-iOS]>
D:      - <XcodeBuild = 10E125 [Target: Toffee-iOS]>
D:      - <XcodeVersion = 10.2 [Target: Toffee-iOS]>
   <- Task __RemObjects_EBuild_Elements_ElementsPreparePlatforms finished for EmptyProject35, took 0.1658s (0.1661s).
   -> Task __RemObjects_EBuild_Elements_ElementsCheckForTargetlessReferences started for EmptyProject35.
   <- Task __RemObjects_EBuild_Elements_ElementsCheckForTargetlessReferences finished for EmptyProject35, took 0.0001s (0.0003s).
   -> Task __RemObjects_EBuild_Elements_ElementsResolveReferences started for EmptyProject35.
      -> Target Toffee-iOS started.
         -> Task __RemObjects_EBuild_Elements_ElementsResolveToffeeReferencesForTarget started for EmptyProject35, Toffee-iOS.
            Reference 'CoreGraphics' was resolved to '/Users/mh/Code/Fire/Bin/Build/macOS/Fire.app/Contents/Resources/Toffee SDKs/iOS 12.2/CoreGraphics.fx' for target 'Toffee-iOS'.
            Reference 'CoreGraphics' was resolved to '/Users/mh/Code/Fire/Bin/Build/macOS/Fire.app/Contents/Resources/Toffee SDKs/iOS 12.2/CoreGraphics.fx' for target 'Toffee-iOS' (Device).
            Reference 'CoreGraphics' was resolved to '/Users/mh/Code/Fire/Bin/Build/macOS/Fire.app/Contents/Resources/Toffee SDKs/iOS 12.2 Simulator/CoreGraphics.fx' for target 'Toffee-iOS' (Simulator).
            Reference 'Foundation' was resolved to '/Users/mh/Code/Fire/Bin/Build/macOS/Fire.app/Contents/Resources/Toffee SDKs/iOS 12.2/Foundation.fx' for target 'Toffee-iOS'.
            Reference 'Foundation' was resolved to '/Users/mh/Code/Fire/Bin/Build/macOS/Fire.app/Contents/Resources/Toffee SDKs/iOS 12.2/Foundation.fx' for target 'Toffee-iOS' (Device).
            Reference 'Foundation' was resolved to '/Users/mh/Code/Fire/Bin/Build/macOS/Fire.app/Contents/Resources/Toffee SDKs/iOS 12.2 Simulator/Foundation.fx' for target 'Toffee-iOS' (Simulator).
            Reference 'UIKit' was resolved to '/Users/mh/Code/Fire/Bin/Build/macOS/Fire.app/Contents/Resources/Toffee SDKs/iOS 12.2/UIKit.fx' for target 'Toffee-iOS'.
            Reference 'UIKit' was resolved to '/Users/mh/Code/Fire/Bin/Build/macOS/Fire.app/Contents/Resources/Toffee SDKs/iOS 12.2/UIKit.fx' for target 'Toffee-iOS' (Device).
            Reference 'UIKit' was resolved to '/Users/mh/Code/Fire/Bin/Build/macOS/Fire.app/Contents/Resources/Toffee SDKs/iOS 12.2 Simulator/UIKit.fx' for target 'Toffee-iOS' (Simulator).
            Reference 'rtl' was resolved to '/Users/mh/Code/Fire/Bin/Build/macOS/Fire.app/Contents/Resources/Toffee SDKs/iOS 12.2/rtl.fx' for target 'Toffee-iOS'.
            Reference 'rtl' was resolved to '/Users/mh/Code/Fire/Bin/Build/macOS/Fire.app/Contents/Resources/Toffee SDKs/iOS 12.2/rtl.fx' for target 'Toffee-iOS' (Device).
            Reference 'rtl' was resolved to '/Users/mh/Code/Fire/Bin/Build/macOS/Fire.app/Contents/Resources/Toffee SDKs/iOS 12.2 Simulator/rtl.fx' for target 'Toffee-iOS' (Simulator).
            Reference 'libToffee' was resolved to '/Users/mh/Code/Elements/Bin/References/Toffee/iOS/libToffee.fx' via XML for target 'Toffee-iOS'.
            Reference 'libToffee' was resolved to '/Users/mh/Code/Elements/Bin/References/Toffee/iOS/libToffee.fx' for target 'Toffee-iOS' (Device).
            Reference 'libToffee' was resolved to '/Users/mh/Code/Elements/Bin/References/Toffee/iOS Simulator/libToffee.fx' for target 'Toffee-iOS' (Simulator).
            Project 'StaticLibrary7' referenced from 'EmptyProject35' is not in solution, reusing cached output.
D:          Project Reference 'StaticLibrary7' will resolve using target 'Toffee-iOS'.
            Project Reference 'StaticLibrary7' was resolved to '/Users/mh/Library/Application Support/RemObjects Software/EBuild/Obj/StaticLibrary7-6F6382946EAF87ABAA0767388BB026B09B2CF31A/Debug/Toffee-iOS/Simulator/libStaticLibrary7.fx' via target 'Toffee-iOS'.
            Reference 'libStaticLibrary7' was resolved to '/Users/mh/Library/Application Support/RemObjects Software/EBuild/Obj/StaticLibrary7-6F6382946EAF87ABAA0767388BB026B09B2CF31A/Debug/Toffee-iOS/Device/libStaticLibrary7.fx' for target 'Toffee-iOS' (Device).
            Reference 'libStaticLibrary7' was resolved to '/Users/mh/Library/Application Support/RemObjects Software/EBuild/Obj/StaticLibrary7-6F6382946EAF87ABAA0767388BB026B09B2CF31A/Debug/Toffee-iOS/Device/libStaticLibrary7.fx' for target 'Toffee-iOS' (Device).
            Reference 'libStaticLibrary7' was resolved to '/Users/mh/Library/Application Support/RemObjects Software/EBuild/Obj/StaticLibrary7-6F6382946EAF87ABAA0767388BB026B09B2CF31A/Debug/Toffee-iOS/Simulator/libStaticLibrary7.fx' for target 'Toffee-iOS' (Simulator).
         <- Task __RemObjects_EBuild_Elements_ElementsResolveToffeeReferencesForTarget finished for EmptyProject35, Toffee-iOS, took 0.0237s (0.0237s).
      <- Target Toffee-iOS finished.
   <- Task __RemObjects_EBuild_Elements_ElementsResolveReferences finished for EmptyProject35, took 0.0264s (0.1952s).
# Nesting & consolidating references...
# Resolve finished at Apr 7, 2019 8:35 PM.
0 Likes

(JohnMoshakis) #12

Thanks for the explanation. I hadn’t thought about the consequences of not having an fx so it makes sense to have the exclamation mark.

1 Like