-
Notifications
You must be signed in to change notification settings - Fork 694
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
Xamarin.Build.Download package id validation causes build errors #1293
Comments
Thanks for your feedback
Nice try, but this is utopistic. The number of artifacts depending on previews will most likely grow. See
To me it smells more like semver parsing (problem with previews).
I work on new bindings tooling and will try to fix this with few utilities from that effort and as soon as possible. Checks have good intention, but can cause problems if not all edge cases are covered (like in this case). |
Why not submitting PR? |
Notes to myself: source + unit tests (tests are in https://github.com/xamarin/XamarinComponents/tree/main/Util/Xamarin.Build.Download/source |
possibly related at least merge together |
@moljac I'd be happy to submit a PR to either remove the check or modify it to allow for the I didn't want to open a PR right away without fully understanding why that check was put there in the first place. I tried a Also, I stumbled across #1248 which looks like the same issue. These could probably be merged. |
I upgraded my Xamarin.Android project to Xamarin.Firebase.Storage to v120.x.x.x to take advantage of the newer firebase emulator APIs, which caused the build error "Invalid item ID firebaseappcheckinterop-16.0.0-beta01".
Related issues reported on StackOverflow:
https://stackoverflow.com/questions/68599578/xamarin-build-download-targets-invalid-id
https://stackoverflow.com/questions/69458719/i-get-the-error-invalid-item-id-firebaseappcheckinterop-16-0-0-beta01-during-b
Digging in, I've determined that the root cause is in
Xamarin.Build.Download.DownloadUtils.ParseDownloadItems(..)
, which is highly opinionated on what should be considered a valid package id. Specifically, it expects that the version component of a package id (in this case,16.0.0-beta01
) should only use periods as separators. Since this version component uses a dash-
before thebeta01
postfix, the id check fails.To confirm this, I cloned the XamarinComponents repo and modified the offending method to exclude the id check:
After packing the modified code and copying the output to my local nuget cache (replacing xamarin.build.download v0.10.0), my Xamarin.Android project compiled and ran without issue.
My recommendations for options to fix:
DownloadUtils
to permit dash-
delimiters ORDownloadUtils
entirely. Unless there's a good reason for this that isn't apparent to me (which is totallypossiblelikely), it seems odd that Xamarin.Build.Download would assume responsibility for enforcing any specific package id/version format.The text was updated successfully, but these errors were encountered: