Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails if app references library which contains framework library inside #15289

Closed
Tracked by #19926
rolfbjarne opened this issue Jun 16, 2022 · 3 comments · Fixed by #15321
Closed
Tracked by #19926

Build fails if app references library which contains framework library inside #15289

rolfbjarne opened this issue Jun 16, 2022 · 3 comments · Fixed by #15321
Assignees
Labels
bug If an issue is a bug or a pull request a bug fix iOS Issues affecting Xamarin.iOS
Milestone

Comments

@rolfbjarne
Copy link
Member

From @nevse on Mon, 13 Jun 2022 11:06:07 GMT

Description

Hello, we are developing DevExpress .NET MAUI controls and experienced the issue described bellow. This issue has a Very High priority for us and we do not have a workaround. Thank you for your help

We are using prevew version of Visual Studio (17.3.0 Preview 1.1) and was straggled with issue while running my app.

C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\15.4.303\targets\Xamarin.Shared.Sdk.targets(656,3): error : Could not find a part of the path 'C:\Users\nevse\Library\Caches\Xamarin\mtbs\builds\EditorsGetStarted\c009c8458d7df2efea22d5e54f441ec27e39739c452fe504252f7d40b77cf6f6\obj\Debug\net6.0-ios\iossimulator-x64\linker-cache\DXListView.framework\DXListView'

To run my app on VS on Windows I am using 'pair to mac' and running app on ios simulator on my mac.
Our bindning library 'Binaries\iOS\iossimulator-x64\DevExpress.Maui.iOS.CollectionView.dll ' contains Framework library with option "false"

Steps to Reproduce

  1. I've prepared the project to reproduce issue. You can find it here https://github.com/nevse/maui-tests-pair-to-mac-static-lib
  2. open solution src\EditorsGetStarted.sln in vs 2022 (17.3.0 Preview 1.1)
  3. pair to mac, choose one of ios emulator and try to run app

you will obtain error similar to below one

error : Could not find a part of the path 'C:\Users\nevse\Library\Caches\Xamarin\mtbs\builds\EditorsGetStarted\c009c8458d7df2efea22d5e54f441ec27e39739c452fe504252f7d40b77cf6f6\obj\Debug\net6.0-ios\iossimulator-x64\linker-cache\DXListView.framework\DXListView

But the real path on mac is 'Users/nevse/library/caches/Xamarin/mtbs/builds/EditorsGetStarted/c009c8458d7df2efea22d5e54f441ec27e39739c452fe504252f7d40b77cf6f6/obj/Debug/net6.0-ios/iossimulator-x64/linker-cache/DXListView.framework/DXListView'

Version with bug

6.0 (current)

Last version that worked well

Release Candidate 3 (current)

Affected platforms

iOS, Windows

Affected platform versions

ios15, windows 10

Did you find any workaround?

No response

Relevant log output

No response

Copied from original issue dotnet/maui#7980

@rolfbjarne
Copy link
Member Author

From @rolfbjarne on Tue, 14 Jun 2022 10:08:45 GMT

Note to self: this seems to be a Windows-only problem, the test solution works fine on macOS.

@rolfbjarne
Copy link
Member Author

From @AntonKosenkoDX on Wed, 15 Jun 2022 09:00:22 GMT

Hello!
It's totally severe bug for us. Is there any workaround?
Thanks.

rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Jun 22, 2022
…d ExtractBindingLibraries step. Fixes xamarin#15289.

In the FilterStaticFrameworks task:

* Convert Windows-style paths to Mac-style paths.
* Give a better error if a framework can't be found.
* Don't try to copy frameworks that don't exist on Windows to the Mac.

In the ExtractBindingLibrariesStep:

* Return a relative path to frameworks we've extracted to make things easier for
  remote builds.

* In the _ComputeFrameworkFilesToPublish target, don't compute the source
  directory for frameworks using RootDir + Directory, because some frameworks
  may only exist on the mac, and RootDir + Directory will be a Windows path
  when building remotely. Instead use 'Identity', which is a relative path and
  will work on both Windows and Mac.

Fixes xamarin#15289.
@dalexsoto dalexsoto added bug If an issue is a bug or a pull request a bug fix iOS Issues affecting Xamarin.iOS labels Jun 30, 2022
@dalexsoto dalexsoto added this to the Future milestone Jun 30, 2022
@Bohdandn
Copy link

Hello! Same problem here - https://github.com/Bohdandn/MAUI.WebRTC.Demo

rolfbjarne added a commit that referenced this issue Jul 11, 2022
…d ExtractBindingLibraries step. Fixes #15289. (#15321)

In the FilterStaticFrameworks task:

* Convert Windows-style paths to Mac-style paths.
* Give a better error if a framework can't be found.
* Don't try to copy frameworks that don't exist on Windows to the Mac.

In the ExtractBindingLibrariesStep:

* Return a relative path to frameworks we've extracted to make things easier for
  remote builds.

* In the _ComputeFrameworkFilesToPublish target, don't compute the source
  directory for frameworks using RootDir + Directory, because some frameworks
  may only exist on the mac, and RootDir + Directory will be a Windows path
  when building remotely. Instead use 'Identity', which is a relative path and
  will work on both Windows and Mac.

Fixes #15289.
vs-mobiletools-engineering-service2 pushed a commit to vs-mobiletools-engineering-service2/xamarin-macios that referenced this issue Jul 11, 2022
…d ExtractBindingLibraries step. Fixes xamarin#15289.

In the FilterStaticFrameworks task:

* Convert Windows-style paths to Mac-style paths.
* Give a better error if a framework can't be found.
* Don't try to copy frameworks that don't exist on Windows to the Mac.

In the ExtractBindingLibrariesStep:

* Return a relative path to frameworks we've extracted to make things easier for
  remote builds.

* In the _ComputeFrameworkFilesToPublish target, don't compute the source
  directory for frameworks using RootDir + Directory, because some frameworks
  may only exist on the mac, and RootDir + Directory will be a Windows path
  when building remotely. Instead use 'Identity', which is a relative path and
  will work on both Windows and Mac.

Fixes xamarin#15289.
vs-mobiletools-engineering-service2 pushed a commit to vs-mobiletools-engineering-service2/xamarin-macios that referenced this issue Jul 11, 2022
…d ExtractBindingLibraries step. Fixes xamarin#15289.

In the FilterStaticFrameworks task:

* Convert Windows-style paths to Mac-style paths.
* Give a better error if a framework can't be found.
* Don't try to copy frameworks that don't exist on Windows to the Mac.

In the ExtractBindingLibrariesStep:

* Return a relative path to frameworks we've extracted to make things easier for
  remote builds.

* In the _ComputeFrameworkFilesToPublish target, don't compute the source
  directory for frameworks using RootDir + Directory, because some frameworks
  may only exist on the mac, and RootDir + Directory will be a Windows path
  when building remotely. Instead use 'Identity', which is a relative path and
  will work on both Windows and Mac.

Fixes xamarin#15289.
vs-mobiletools-engineering-service2 pushed a commit to vs-mobiletools-engineering-service2/xamarin-macios that referenced this issue Jul 11, 2022
…d ExtractBindingLibraries step. Fixes xamarin#15289.

In the FilterStaticFrameworks task:

* Convert Windows-style paths to Mac-style paths.
* Give a better error if a framework can't be found.
* Don't try to copy frameworks that don't exist on Windows to the Mac.

In the ExtractBindingLibrariesStep:

* Return a relative path to frameworks we've extracted to make things easier for
  remote builds.

* In the _ComputeFrameworkFilesToPublish target, don't compute the source
  directory for frameworks using RootDir + Directory, because some frameworks
  may only exist on the mac, and RootDir + Directory will be a Windows path
  when building remotely. Instead use 'Identity', which is a relative path and
  will work on both Windows and Mac.

Fixes xamarin#15289.
rolfbjarne added a commit that referenced this issue Jul 14, 2022
…Frameworks task and ExtractBindingLibraries step. Fixes #15289. (#15442)

In the FilterStaticFrameworks task:

* Convert Windows-style paths to Mac-style paths.
* Give a better error if a framework can't be found.
* Don't try to copy frameworks that don't exist on Windows to the Mac.

In the ExtractBindingLibrariesStep:

* Return a relative path to frameworks we've extracted to make things easier for
  remote builds.

* In the _ComputeFrameworkFilesToPublish target, don't compute the source
  directory for frameworks using RootDir + Directory, because some frameworks
  may only exist on the mac, and RootDir + Directory will be a Windows path
  when building remotely. Instead use 'Identity', which is a relative path and
  will work on both Windows and Mac.

Fixes #15289.


Backport of #15321

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
rolfbjarne added a commit that referenced this issue Jul 14, 2022
…Frameworks task and ExtractBindingLibraries step. Fixes #15289. (#15444)

In the FilterStaticFrameworks task:

* Convert Windows-style paths to Mac-style paths.
* Give a better error if a framework can't be found.
* Don't try to copy frameworks that don't exist on Windows to the Mac.

In the ExtractBindingLibrariesStep:

* Return a relative path to frameworks we've extracted to make things easier for
  remote builds.

* In the _ComputeFrameworkFilesToPublish target, don't compute the source
  directory for frameworks using RootDir + Directory, because some frameworks
  may only exist on the mac, and RootDir + Directory will be a Windows path
  when building remotely. Instead use 'Identity', which is a relative path and
  will work on both Windows and Mac.

Fixes #15289.


Backport of #15321

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
dalexsoto pushed a commit that referenced this issue Jul 19, 2022
… task and ExtractBindingLibraries step. Fixes #15289. (#15443)

* [msbuild/tools] Fix path issues in the FilterStaticFrameworks task and ExtractBindingLibraries step. Fixes #15289.

In the FilterStaticFrameworks task:

* Convert Windows-style paths to Mac-style paths.
* Give a better error if a framework can't be found.
* Don't try to copy frameworks that don't exist on Windows to the Mac.

In the ExtractBindingLibrariesStep:

* Return a relative path to frameworks we've extracted to make things easier for
  remote builds.

* In the _ComputeFrameworkFilesToPublish target, don't compute the source
  directory for frameworks using RootDir + Directory, because some frameworks
  may only exist on the mac, and RootDir + Directory will be a Windows path
  when building remotely. Instead use 'Identity', which is a relative path and
  will work on both Windows and Mac.

Fixes #15289.

* [msbuild/tools] Fix logic to do the right thing.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
@ghost ghost locked as resolved and limited conversation to collaborators Aug 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug If an issue is a bug or a pull request a bug fix iOS Issues affecting Xamarin.iOS
Projects
None yet
3 participants