Astronomy sample does not build - file path for java src not found.

LWG 0 Reputation points
2024-12-02T19:45:54.25+00:00

Severity Code Description Project File Line Suppression State

Error (active) XA5301 Failed to generate Java type for class: Google.Android.Material.Behavior.HideBottomViewOnScrollBehavior/IOnScrollStateChangedListenerImplementor due to MAX_PATH: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\LWGar\Source\Repos\mslearn-dotnetmaui-create-multi-page-apps\exercise1\start\Astronomy\Astronomy\obj\Debug\net8.0-android\android\src\mono\com\google\android\material\behavior\HideBottomViewOnScrollBehavior_OnScrollStateChangedListenerImplementor.java'.

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)

at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)

at Microsoft.Android.Build.Tasks.Files.CopyIfStreamChanged(Stream stream, String destination) in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/Files.cs:line 170

at Xamarin.Android.Tasks.GenerateJavaStubs.CreateJavaSources(IEnumerable`1 newJavaTypes, TypeDefinitionCache cache, MarshalMethodsClassifier classifier, Boolean useMarshalMethods) Astronomy (net8.0-android) C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.113\tools\Xamarin.Android.Common.targets 1536

Developer technologies .NET .NET MAUI
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. LWG 0 Reputation points
    2024-12-02T21:59:52.7266667+00:00

    Tried a different machine with jdk installed and all is well.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.