You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The AndroidMavenLibrary library and dependency resolution that happens in <MavenDownload/> can fail and produce less than ideal error messaging. It would be great if we could improve the logging to report which (if any) dependencies can be resolved, and which ones fail.
In the case of com.revenuecat.purchases:purchases-ui described below it seems that this library itself can be resolved, but somewhere along the way we encounter an error that is not actionable:
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/35.0.24/tools/Xamarin.Android.Bindings.Maven.targets(28,5): error XA4237: Cannot download POM file for Maven artifact 'com.revenuecat.purchases:purchases-ui:8.11.0'.
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/35.0.24/tools/Xamarin.Android.Bindings.Maven.targets(28,5): error XA4237: - Response status code does not indicate success: 404 (Not Found).
Steps to Reproduce
dotnet new android
Update the .csproj to include the following and build it:
I can work around this by setting the VerifyDependencies metadata to false, however this also suppresses messaging about the dependencies of this library:
I think the way this should work is the POM should specify other repositories to check for dependencies, but this POM does not do this.
Additionally, I don't think we check that section today, so it wouldn't work even if the POM did specify the Google repository.
This error is occuring in the MavenDownload task. This may be the wrong place. It might should simply log a warning that it could not download a POM file, and then let the JavaDependencyVerification handle the rest. I think that would move the error to XA4247. There might be better logging coming from JavaDependencyVerification than MavenDownload.
Doing it this way would also allow a user to work around the issue by manually downloading the POM and adding it to their project as <AndroidAdditionalJavaManifest> if desired.
@jpobst Is it possible to use AndroidAdditionalJavaManifest to specify a locally downloaded POM at this point, or is that only with .Net 10?
We're getting the same issue with com.google.firebase:firebase-pom's resolution. We use a custom repo for distributing our own Maven libraries, but when it hits dependency resolution, it's failing on that one. I've contemplated either making a FAT AAR of it, but that's not optimal, or manually pulling all the files needed and uploading them to our maven repo, but that also doesn't make sense for us to do, with it up on Google's repo.
Activity
jpobst commentedon Jan 24, 2025
Yeah, the error message is definitely less than ideal. It is actually failing to download the POM for one of its dependencies:
This is because this POM is from Google and not Maven Central:
I think the way this should work is the POM should specify other repositories to check for dependencies, but this POM does not do this.
Additionally, I don't think we check that section today, so it wouldn't work even if the POM did specify the Google repository.
This error is occuring in the
MavenDownloadtask. This may be the wrong place. It might should simply log a warning that it could not download a POM file, and then let theJavaDependencyVerificationhandle the rest. I think that would move the error to XA4247. There might be better logging coming fromJavaDependencyVerificationthanMavenDownload.Doing it this way would also allow a user to work around the issue by manually downloading the POM and adding it to their project as
<AndroidAdditionalJavaManifest>if desired.stricklandconsulting commentedon May 6, 2025
@jpobst Is it possible to use AndroidAdditionalJavaManifest to specify a locally downloaded POM at this point, or is that only with .Net 10?
We're getting the same issue with com.google.firebase:firebase-pom's resolution. We use a custom repo for distributing our own Maven libraries, but when it hits dependency resolution, it's failing on that one. I've contemplated either making a FAT AAR of it, but that's not optimal, or manually pulling all the files needed and uploading them to our maven repo, but that also doesn't make sense for us to do, with it up on Google's repo.
jpobst commentedon May 6, 2025
<AndroidAdditionalJavaManifest>was added in .NET 9. Another option would be to use<AndroidIgnoredJavaDependency>.[xabt] Improve Maven POM resolution errors (dotnet#12320)