Skip to content

Build fails with .scnassets in .NET MAUI #15104

@DavidBerschauer

Description

@DavidBerschauer

Steps to Reproduce

  1. Create blank .NET MAUI project
  2. Add a directory Platforms/iOS/Resources/art.scnassets
  3. Add scene files
  4. Build project for iOS

(Same for macOS)

Expected Behavior

The scene files get bundled up as SceneKitAssets.

Actual Behavior

System.UnauthorizedAccessException: Access to the path '*ProjectDir*/obj/Debug/net6.0-ios/ios-arm64/copySceneKitAssets/*ProjectName*.app/Resources/art.scnassets/*SceneFile*.scn' is denied.

The given path is actually a directory, named after the scene file:
top: build output obj directory
bottom: project directory
Bildschirmfoto 2022-05-24 um 09 47 30

This behavior can be reproduced with any file. The build always creates a new directory inside the .../copySceneKitAssets/*.app/Resources/art.scnassets directory with the name and extension of the first file in the art.scnassets directory.

In Xamarin.Forms this is working fine, the scene files are copied to *ProjectName*.app/Resources/art.scnassets/... and can later be loaded into SceneKit.

Environment

Version information
Visual Studio Community 2022 for Mac Preview
Version 17.3 Preview (17.3 build 191)

Installation UUID: b6f20592-f057-4b30-a0d8-b9d38f0905cc

Runtime
.NET 6.0.3 (64-bit)
Architecture: Arm64

Roslyn (Language Service)
4.2.0-3.22181.8+a59a22c6f3c2cc1883e20cece412209f18f4a29f

NuGet
Version: 6.0.0.262

.NET SDK (Arm64)
SDK: /usr/local/share/dotnet/sdk/6.0.300/Sdks
SDK-Versionen:
	6.0.300
	6.0.300-preview.22201.10
	6.0.202
	6.0.201
MSBuild-SDKs: /usr/local/share/dotnet/sdk/6.0.300/Sdks

.NET SDK (x64)
SDK-Versionen:
	6.0.300
	6.0.203
	6.0.202
	6.0.105
	6.0.104
	6.0.408
	6.0.407
	6.0.406
	3.1.419
	3.1.418
	3.1.417

.NET Runtime (Arm64)
Laufzeit: /usr/local/share/dotnet/dotnet
Laufzeitversionen:
	7.0.4
	7.0.3
	7.0.2
	2.0.9 (x64 – Nicht unterstützt)
	1.1.13 (x64 – Nicht unterstützt)
	1.0.16 (x64 – Nicht unterstützt)

.NET Runtime (x64)
Laufzeit: /usr/local/share/dotnet/x64/dotnet
Laufzeitversionen:
	6.0.5
	6.0.4
	5.0.17
	5.0.16
	5.0.15
	3.1.25
	3.1.24
	3.1.23

Xamarin.Profiler
Version: 1.8.0.19
Speicherort: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Updater
Version: 11

Xamarin.Android
Version: 12.2.4.3 (Visual Studio Community)
Commit: xamarin-android/d17-1/fc1125e
Android SDK: /Users/david/Library/Android/sdk
	Unterstützte Android-Versionen:
		6.0  (API-Ebene 23)
		12.0 (API-Ebene 31)
		8.1  (API-Ebene 27)
		5.1  (API-Ebene 22)
		5.0  (API-Ebene 21)
		11.0 (API-Ebene 30)
		10.0 (API-Ebene 29)
		9.0  (API-Ebene 28)
		8.0  (API-Ebene 24)

Version der SDK-Befehlszeilentools: 5.0
Version der SDK-Plattformtools: 33.0.1
Version der SDK-Buildtools: 31.0.0

Buildinformationen: 
Mono: adf1bc4
Java.Interop: xamarin/java.interop/d17-1@7ac33610
ProGuard: Guardsquare/proguard/v7.0.1@912d149
SQLite: xamarin/sqlite/3.37.1@0893b3b
Xamarin.Android Tools: xamarin/xamarin-android-tools/d17-1@db125a7

Microsoft Build of OpenJDK
Java SDK: /Library/Java/JavaVirtualMachines/microsoft-11.jdk
11.0.12
EPL-Code für Android Designer hier verfügbar:
https://github.com/xamarin/AndroidDesigner.EPL

Eclipse Temurin JDK
Java SDK: /Library/Java/JavaVirtualMachines/temurin-8.jdk
1.8.0.302
EPL-Code für Android Designer hier verfügbar:
https://github.com/xamarin/AndroidDesigner.EPL

Android SDK Manager
Version: 17.2.0.47
Hash: d6dd135
Branch: remotes/origin/dev/tondat/main-1512059~2
Build date: 2022-05-19 16:00:33 UTC

Android Device Manager
Version: 0.0.0.1127
Hash: 4bb4d48
Branch: remotes/origin/dev/tondat/main-1536295~1
Build date: 2022-05-19 16:00:33 UTC

Apple Developer Tools
Xcode 13.4 (20503)
Build 13F17a

Xamarin.Mac
Version: 8.8.0.3 (Visual Studio Community)
Hash: eb7f8ed35
Branch: xcode13.3
Build date: 2022-03-30 03:16:09-0400

Xamarin.iOS
Version: 15.8.0.3 (Visual Studio Community)
Hash: eb7f8ed35
Branch: xcode13.3
Build date: 2022-03-30 03:16:09-0400

Xamarin Designer
Version: 17.3.0.70
Hash: 4cf1a2208
Branch: remotes/origin/d17-3
Build date: 2022-05-19 16:00:39 UTC

Build Information
Release ID: 1703000191
Git revision: 6e028abf3763bf8fde618c0de2c24b1091eb76d8
Build date: 2022-05-19 15:58:40+00
Build branch: release-17.3
Build lane: release-17.3

Operating System
Mac OS X 12.3.1
Darwin 21.4.0 Darwin Kernel Version 21.4.0
    Fri Mar 18 00:46:32 PDT 2022
    root:xnu-8020.101.4~15/RELEASE_ARM64_T6000 arm64

The project is build with .NET MAUI RC3.

Build Logs

msbuild.binlog.zip

Example Project (If Possible)

This project is the default .NET MAUI template with a simple scene file.
SceneKitDemo.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    dotnetAn issue or pull request related to .NET (6)msbuildIssues affecting our msbuild tasks/targets

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions