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

Visual Studio 17.7.0 Pre2 / Dotnet 8 8.0.100-preview.5.23303.2 / MAUI 8.0.0-preview.5.8529 build error XAGJS7023 for Android #15947

Closed
rogerbriggen-securiton opened this issue Jun 30, 2023 · 3 comments
Assignees
Labels
partner/android Issues for the Android SDK platform/android 🤖 s/needs-repro Attach a solution or code which reproduces the issue t/bug Something isn't working

Comments

@rogerbriggen-securiton
Copy link

Description

I try to compile my project with dotnet 8 and I get the same error as mentioned here: #12945

In my .csproj we have Windows, iOS and Android as platform and :
true

"C:\Program Files\dotnet\dotnet.exe" build C:\BuildAgent\work\ef497e914ee5fdcb\MyProject.sln --configuration Release

17:27:48 C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.5.312\tools\Xamarin.Android.Common.targets(1513,3): error XAGJS7023: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\BuildAgent\work\ef497e914ee5fdcb\MyProject\obj\Release\net8.0-android\android-arm\linked\Mono.Android.dll'. [C:\BuildAgent\work\ef497e914ee5fdcb\MyProject\MyProject.csproj::TargetFramework=net8.0-android]
17:27:48 [ERR] C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.5.312\tools\Xamarin.Android.Common.targets(1513,3): error XAGJS7023: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\BuildAgent\work\ef497e914ee5fdcb\MyProject\obj\Release\net8.0-android\android-arm\linked\Mono.Android.dll'. [C:\BuildAgent\work\ef497e914ee5fdcb\MyProject\MyProject.csproj::TargetFramework=net8.0-android]
17:27:48 C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.5.312\tools\Xamarin.Android.Common.targets(1513,3): error XAGJS7023: at System.IO.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite) [C:\BuildAgent\work\ef497e914ee5fdcb\MyProject\MyProject.csproj::TargetFramework=net8.0-android]
17:27:48 [ERR] C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.5.312\tools\Xamarin.Android.Common.targets(1513,3): error XAGJS7023: at System.IO.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite) [C:\BuildAgent\work\ef497e914ee5fdcb\MyProject\MyProject.csproj::TargetFramework=net8.0-android]
17:27:48 C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.5.312\tools\Xamarin.Android.Common.targets(1513,3): error XAGJS7023: at Xamarin.Android.Tasks.MarshalMethodsAssemblyRewriter.g__CopyFile|6_0(String source, String target) [C:\BuildAgent\work\ef497e914ee5fdcb\MyProject\MyProject.csproj::TargetFramework=net8.0-android]
17:27:48 [ERR] C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.5.312\tools\Xamarin.Android.Common.targets(1513,3): error XAGJS7023: at Xamarin.Android.Tasks.MarshalMethodsAssemblyRewriter.g__CopyFile|6_0(String source, String target) [C:\BuildAgent\work\ef497e914ee5fdcb\MyProject\MyProject.csproj::TargetFramework=net8.0-android]
17:27:48 C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.5.312\tools\Xamarin.Android.Common.targets(1513,3): error XAGJS7023: at Xamarin.Android.Tasks.MarshalMethodsAssemblyRewriter.Rewrite(DirectoryAssemblyResolver resolver, List1 targetAssemblyPaths, Boolean brokenExceptionTransitions) [C:\BuildAgent\work\ef497e914ee5fdcb\MyProject\MyProject.csproj::TargetFramework=net8.0-android] 17:27:48 [ERR] C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.5.312\tools\Xamarin.Android.Common.targets(1513,3): error XAGJS7023: at Xamarin.Android.Tasks.MarshalMethodsAssemblyRewriter.Rewrite(DirectoryAssemblyResolver resolver, List1 targetAssemblyPaths, Boolean brokenExceptionTransitions) [C:\BuildAgent\work\ef497e914ee5fdcb\MyProject\MyProject.csproj::TargetFramework=net8.0-android]
17:27:48 C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.5.312\tools\Xamarin.Android.Common.targets(1513,3): error XAGJS7023: at Xamarin.Android.Tasks.GenerateJavaStubs.Run(DirectoryAssemblyResolver res, Boolean useMarshalMethods) [C:\BuildAgent\work\ef497e914ee5fdcb\MyProject\MyProject.csproj::TargetFramework=net8.0-android]
17:27:48 [ERR] C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.5.312\tools\Xamarin.Android.Common.targets(1513,3): error XAGJS7023: at Xamarin.Android.Tasks.GenerateJavaStubs.Run(DirectoryAssemblyResolver res, Boolean useMarshalMethods) [C:\BuildAgent\work\ef497e914ee5fdcb\MyProject\MyProject.csproj::TargetFramework=net8.0-android]
17:27:48 C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.5.312\tools\Xamarin.Android.Common.targets(1513,3): error XAGJS7023: at Xamarin.Android.Tasks.GenerateJavaStubs.RunTask() [C:\BuildAgent\work\ef497e914ee5fdcb\MyProject\MyProject.csproj::TargetFramework=net8.0-android]
17:27:48 [ERR] C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.5.312\tools\Xamarin.Android.Common.targets(1513,3): error XAGJS7023: at Xamarin.Android.Tasks.GenerateJavaStubs.RunTask() [C:\BuildAgent\work\ef497e914ee5fdcb\MyProject\MyProject.csproj::TargetFramework=net8.0-android]
17:27:48 C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.5.312\tools\Xamarin.Android.Common.targets(1513,3): error XAGJS7023: at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25 [C:\BuildAgent\work\ef497e914ee5fdcb\MyProject\MyProject.csproj::TargetFramework=net8.0-android]
17:27:48 [ERR] C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.5.312\tools\Xamarin.Android.Common.targets(1513,3): error XAGJS7023: at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25 [C:\BuildAgent\work\ef497e914ee5fdcb\MyProject\MyProject.csproj::TargetFramework=net8.0-android]
17:27:49

Steps to Reproduce

  1. Install latest dotnet 8 preview with MAUI
  2. Create a maui project
  3. Enable ipa and apk during build
  4. build release mode

Link to public reproduction project repository

Version with bug

Unknown/Other

Last version that worked well

7.0.86

Affected platforms

Android

Affected platform versions

Android

Did you find any workaround?

No

Relevant log output

17:27:48     C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.5.312\tools\Xamarin.Android.Common.targets(1513,3): error XAGJS7023:    at Xamarin.Android.Tasks.GenerateJavaStubs.Run(DirectoryAssemblyResolver res, Boolean useMarshalMethods) [C:\BuildAgent\work\ef497e914ee5fdcb\MyProject\MyProject.csproj::TargetFramework=net8.0-android]
17:27:48     [ERR] C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.5.312\tools\Xamarin.Android.Common.targets(1513,3): error XAGJS7023:    at Xamarin.Android.Tasks.GenerateJavaStubs.Run(DirectoryAssemblyResolver res, Boolean useMarshalMethods) [C:\BuildAgent\work\ef497e914ee5fdcb\MyProject\MyProject.csproj::TargetFramework=net8.0-android]
17:27:48     C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.5.312\tools\Xamarin.Android.Common.targets(1513,3): error XAGJS7023:    at Xamarin.Android.Tasks.GenerateJavaStubs.RunTask() [C:\BuildAgent\work\ef497e914ee5fdcb\MyProject\MyProject.csproj::TargetFramework=net8.0-android]
17:27:48     [ERR] C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.5.312\tools\Xamarin.Android.Common.targets(1513,3): error XAGJS7023:    at Xamarin.Android.Tasks.GenerateJavaStubs.RunTask() [C:\BuildAgent\work\ef497e914ee5fdcb\MyProject\MyProject.csproj::TargetFramework=net8.0-android]
17:27:48     C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.5.312\tools\Xamarin.Android.Common.targets(1513,3): error XAGJS7023:    at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25 [C:\BuildAgent\work\ef497e914ee5fdcb\MyProject\MyProject.csproj::TargetFramework=net8.0-android]
17:27:48     [ERR] C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.0-preview.5.312\tools\Xamarin.Android.Common.targets(1513,3): error XAGJS7023:    at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25 [C:\BuildAgent\work\ef497e914ee5fdcb\MyProject\MyProject.csproj::TargetFramework=net8.0-android]
17:27:49
@rogerbriggen-securiton rogerbriggen-securiton added the t/bug Something isn't working label Jun 30, 2023
@rogerbriggen-securiton rogerbriggen-securiton changed the title Visual Studio 17.7.0 Pre2 / Dotnet 8 8.0.100-preview.5.23303.2 Android not compiling Visual Studio 17.7.0 Pre2 / Dotnet 8 8.0.100-preview.5.23303.2 build error XAGJS7023 for Android Jun 30, 2023
@rogerbriggen-securiton rogerbriggen-securiton changed the title Visual Studio 17.7.0 Pre2 / Dotnet 8 8.0.100-preview.5.23303.2 build error XAGJS7023 for Android Visual Studio 17.7.0 Pre2 / Dotnet 8 8.0.100-preview.5.23303.2 / MAUI 8.0.0-preview.5.8529 build error XAGJS7023 for Android Jun 30, 2023
@samhouts samhouts added the partner/android Issues for the Android SDK label Aug 3, 2023
@dellis1972 dellis1972 self-assigned this Aug 22, 2023
@dellis1972
Copy link
Contributor

I cannot repo this on .net 8 preview 7 (8.0.100-preview.7.23376.3)
We think it is because we disabled Marshal methods. We shall log this issue for future work.

In the mean time try adding the following to your build command see if that helps.

-p:AndroidEnableMarshalMethods=false

@samhouts samhouts added the s/needs-repro Attach a solution or code which reproduces the issue label Sep 18, 2023
@ghost
Copy link

ghost commented Sep 18, 2023

Hi @rogerbriggen-securiton. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@ghost ghost added the s/no-recent-activity Issue has had no recent activity label Sep 22, 2023
@ghost
Copy link

ghost commented Sep 22, 2023

This issue has been automatically marked as stale because it has been marked as requiring author feedback to reproduce the issue but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

@ghost ghost closed this as completed Sep 25, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Oct 26, 2023
@ghost ghost removed the s/no-recent-activity Issue has had no recent activity label Feb 1, 2024
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
partner/android Issues for the Android SDK platform/android 🤖 s/needs-repro Attach a solution or code which reproduces the issue t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants