Tags: dotnet/android-libraries
Tags
Remove `Square.OkHttp` (#1258) Context: https://www.nuget.org/packages/Square.OkHttp Context: https://nvd.nist.gov/vuln/detail/cve-2023-3635 `Square.OkHttp` version 2.x has a known CVE, and you should use `Square.OkHttp3` instead. Removing from this repo to verify everything builds without it. We don't want to release future versions of it.
Add the `AICore` artifact (#1256) * Add AICore library * Add AICore license: * https://developer.android.com/ai/gemini-nano/experimental/terms
Add `Xamarin.Google.AI.Edge.LocalAgents` (#1243) This PR adds three new Google Maven artifacts to the `config.json` configuration file to enable .NET for Android bindings for new Google AI and MediaPipe libraries, with improved proto namespace handling to resolve compilation issues. ## Added Artifacts ### Google AI Edge LocalAgents * **com.google.ai.edge.localagents:localagents-fc** (v0.1.0) → `Xamarin.Google.AI.Edge.LocalAgents.FunctionCalling` * **com.google.ai.edge.localagents:localagents-rag** (v0.2.0) → `Xamarin.Google.AI.Edge.LocalAgents.RAG` * Added configuration and namespace mappings for `LocalAgents.FunctionCalling`, `LocalAgents.RAG`, `ToolRetrieval`, `MediaPipe`, `LlmInference`, and `GenAI` in `Directory.Build.props` and `config.json`, enabling new AI features and integrations. * Published new namespaces for these libraries, including * `Google.AI.Edge.LocalAgents.FunctionCalling`, * `Google.AI.Edge.LocalAgents.RAG.*`, and * `Google.MediaPipe.Tasks.GenAI.LlmInference`. **AndroidX.Media3 API enhancements:** * Introduced numerous new properties and methods that utilize immutable collections (`ImmutableList`, `ImmutableMap`, `ImmutableSet`) for track selection, metadata, configuration, and timeline management, improving API consistency and safety. * Added new static utility methods for working with immutable collections in bundles, such as `BundleToStringImmutableMap` and `GetList`. **Dependency and version updates:** * Updated the `nugetVersion` for `Xamarin.Firebase.Firestore` to `126.0.0.1` to reflect a new release. **Published namespaces expansion:** * Added new published namespaces for `Google.Common.Collect` and related sub-namespaces, supporting the new immutable collection features in the API. These changes collectively enable new AI/ML capabilities, improve API ergonomics for AndroidX.Media3, and ensure up-to-date dependency management. Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
[Xamarin.GoogleAndroid.Libraries.Places] Exclude the OkHttp dependency ( #1246) It is not needed as the underlying library uses `grpc-okhttp` instead. This is a fork and modification of the `OkHttp` library and the code says it is 2.5.0+ https://github.com/grpc/grpc-java/blob/f50726d32e216746642513add28e086094ce5506/okhttp/third_party/okhttp/main/java/io/grpc/okhttp/internal/Platform.java#L18
Fix missing code in Square.OkHttp3 5.0.0+ (#1239) Fixes: #1230 From OkHttp version 5.0.0+, Square changed their packaging strategy to provide separate JVM and Android artifacts. The regular `com.squareup.okhttp3:okhttp` artifact is now just an empty placeholder for Android (containing only 767 bytes of metadata), while the actual Android implementation has been moved to `com.squareup.okhttp3:okhttp-android`. This change caused the generated Square.OkHttp3 NuGet packages version 5.0.0+ to be empty, as they were binding the placeholder JAR instead of the real Android implementation. However, other packages (like Retrofit 3.0.0) still depend on the legacy `okhttp` artifact, so simply switching artifacts would break dependency resolution. ## Solution This PR implements a dual-package approach with full backward compatibility: 1. **Legacy compatibility package**: `com.squareup.okhttp3:okhttp:5.1.0` - Marked as `dependencyOnly: true` to satisfy existing dependencies - Contains **type forwarders** for all 50 public types to Square.OkHttp3.Android - NuGet package: `Square.OkHttp3` (maintains existing package ID) - Includes `extraDependencies` to automatically bring in `Square.OkHttp3.Android` 2. **New Android implementation package**: `com.squareup.okhttp3:okhttp-android:5.1.0` - Contains the actual 839KB Android implementation - All existing binding customizations moved to `source/com.squareup.okhttp3/okhttp-android/` - NuGet package: `Square.OkHttp3.Android` (new package ID) ## Type Forwarders for Seamless Migration Added comprehensive type forwarding in `TypeForwards.cs` to ensure existing C# code continues working: ```csharp [assembly:TypeForwardedToAttribute(typeof(Square.OkHttp3.OkHttpClient))] [assembly:TypeForwardedToAttribute(typeof(Square.OkHttp3.Request))] [assembly:TypeForwardedToAttribute(typeof(Square.OkHttp3.Response))] // ... and 47 more types ``` ## Changes Made - **config.json**: Added separate entries for both `okhttp` (legacy) and `okhttp-android` (new implementation) - **Version bumping**: All com.squareup.okhttp3 packages updated to 5.1.0.1 (revision bump) - **Source structure**: Created `source/com.squareup.okhttp3/okhttp/Additions/TypeForwards.cs` - **Dependency resolution**: Fixed dependency resolution errors by adding `okhttp:5.1.0` as dependency-only package - **NuGet dependencies**: Added `extraDependencies` to make Square.OkHttp3 depend on Square.OkHttp3.Android This approach ensures backward compatibility while providing access to the correct OkHttp Android functionality. Retrofit and other packages can still resolve their `okhttp` dependencies, existing code using `Square.OkHttp3` types continues to work through type forwarders, and consumers automatically get the actual Android implementation. Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
Stable Updates 20250728 (#1234) Fixes: #1233 This PR implements the stable updates for Android libraries as of July 28, 2025, updating Maven artifact versions to their latest available releases and fixing compilation errors in Firebase packages. Updated 41 Maven artifacts to their latest stable versions (reverted com.google.dagger from 2.57.0 to 2.56.2 due to dependency resolution issues): - **Google Play Services**: ads (24.4.0→24.5.0), auth (21.3.0→21.4.0), measurement (22.5.0→23.0.0) - **Google Ads**: Interactive Media updated from 3.36.0 to 3.37.0 (now prerelease 3.37.0.1-beta01) - **Firebase**: Multiple libraries updated to latest stable versions - **Third-party dependencies**: ~~Dagger (2.56.2→2.57.0)~~ reverted, GRPC (1.73.0→1.74.0), Error Prone annotations updated The updated Firebase packages introduced compilation errors: error CS0738: 'FirebaseSessionsComponent_MainModule_Companion_SessionDataStoreFactory' does not implement interface member 'IProvider.Get()'. 'FirebaseSessionsComponent_MainModule_Companion_SessionDataStoreFactory.Get()' cannot implement 'IProvider.Get()' because it does not have the matching return type of 'Object'. error CS0111: Type 'DoubleCheck' already defines a member called 'Lazy' with the same parameter types error CS0111: Type 'DoubleCheck' already defines a member called 'Provider' with the same parameter types Fixed Firebase compilation errors in `firebase-sessions` and `firebase-functions` packages: 1. **Interface Implementation Fix**: Created an Additions file for `FirebaseSessionsComponent_MainModule_Companion_SessionDataStoreFactory` that properly implements `IProvider.Get()` with the correct return type of `Java.Lang.Object`. 2. **Duplicate Method Removal**: Added remove-node entries in Metadata.xml for both packages to eliminate duplicate `Lazy` and `Provider` methods in the `DoubleCheck` class that were causing CS0111 compilation errors. Interactive Media package had NU5104 errors due to stable package depending on prerelease PrivacySandbox dependencies: error NU5104: A stable release of a package should not have a prerelease dependency. Either modify the version spec of dependency "Xamarin.AndroidX.PrivacySandbox.Ads.AdsServices.Java [1.1.0.2-beta12, )" or update the version field in the nuspec. Updated Interactive Media package to prerelease version 3.37.0.1-beta01 to allow proper dependency on PrivacySandbox beta packages without violating NuGet's stable-to-prerelease dependency rules. Unit tests were failing with 7zip location errors on Linux builds: System.Exception : Could not find 7zip.exe in Xamarin installation Enhanced VS7ZipLocator to detect system-installed 7z on Linux platforms by checking `/usr/bin/7z` before falling back to Windows-specific paths. This fixes unit test failures related to archive extraction functionality and ensures proper cross-platform compatibility. When HTTP 404 errors occur during the binderate process, the error messages do not provide enough context about which specific Maven dependency failed to resolve: Dependency errors : 1 1 System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found). at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() at System.Net.Http.HttpClient.GetStreamAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken) Updated the code to better log errors. Through code analysis, identified that the error occurs during AggregateException handling in `BinderateCommand.cs`, not in the `ProjectResolver.Resolve` method as initially assumed. The most effective locations for adding detailed dependency logging are: 1. **BindingProjectConverter.cs line 31** - Where individual artifacts are processed via `MavenFactory2.GetPomForArtifact()` 2. **BinderateCommand.cs lines 55-72** - In the AggregateException handler where errors are formatted 3. **MavenFactory2.cs line 34** - In the `GetPomForArtifact` method where dependency resolution occurs Reverted com.google.dagger from version 2.57.0 back to the stable 2.56.2 due to dependency resolution failures during the binderate process. The dependency resolution error was specifically: com.google.dagger.dagger:2.57.0 Failed to resolve dependency: com.google.dagger:dagger:2.57.0 Artifact details - GroupId: com.google.dagger, ArtifactId: dagger, Version: 2.57.0 Full artifact string: com.google.dagger:dagger:2.57.0 This investigation provides the foundation for implementing proper dependency error logging that will identify which specific Maven artifacts fail to resolve, making debugging much more effective. The following files have been regenerated with the latest configuration: - Component governance manifest (cgmanifest.json) - Published namespaces list (published-namespaces.txt) - Artifact list with versions (docs/artifact-list-with-versions.md) Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com> Co-authored-by: sheiksyedm <23059975+sheiksyedm@users.noreply.github.com>
Stable Updates 20250718 (#1223) 1. `androidx.annotation:annotationexperimental` - 1.5.0 -> 1.5.1 2. `androidx.car.app:app` - 1.4.0 -> 1.7.0 3. `androidx.concurrent:concurrentfutures` - 1.2.0 -> 1.3.0 4. `androidx.concurrent:concurrentfuturesktx` - 1.2.0 -> 1.3.0 5. `androidx.lifecycle:lifecyclecommon` - 2.9.1 -> 2.9.2 6. `androidx.lifecycle:lifecyclecommonjava8` - 2.9.1 -> 2.9.2 7. `androidx.lifecycle:lifecyclecommonjvm` - 2.9.1 -> 2.9.2 8. `androidx.lifecycle:lifecyclelivedata` - 2.9.1 -> 2.9.2 9. `androidx.lifecycle:lifecyclelivedatacore` - 2.9.1 -> 2.9.2 10. `androidx.lifecycle:lifecyclelivedatacorektx` - 2.9.1 -> 2.9.2 11. `androidx.lifecycle:lifecyclelivedataktx` - 2.9.1 -> 2.9.2 12. `androidx.lifecycle:lifecycleprocess` - 2.9.1 -> 2.9.2 13. `androidx.lifecycle:lifecyclereactivestreams` - 2.9.1 -> 2.9.2 14. `androidx.lifecycle:lifecycleruntime` - 2.9.1 -> 2.9.2 15. `androidx.lifecycle:lifecycleruntimeandroid` - 2.9.1 -> 2.9.2 16. `androidx.lifecycle:lifecycleruntimecompose` - 2.9.1 -> 2.9.2 17. `androidx.lifecycle:lifecycleruntimecomposeandroid` - 2.9.1 -> 2.9.2 18. `androidx.lifecycle:lifecycleruntimektx` - 2.9.1 -> 2.9.2 19. `androidx.lifecycle:lifecycleruntimektxandroid` - 2.9.1 -> 2.9.2 20. `androidx.lifecycle:lifecycleservice` - 2.9.1 -> 2.9.2 21. `androidx.lifecycle:lifecycleviewmodel` - 2.9.1 -> 2.9.2 22. `androidx.lifecycle:lifecycleviewmodelandroid` - 2.9.1 -> 2.9.2 23. `androidx.lifecycle:lifecycleviewmodelcompose` - 2.9.1 -> 2.9.2 24. `androidx.lifecycle:lifecycleviewmodelcomposeandroid` - 2.9.1 -> 2.9.2 25. `androidx.lifecycle:lifecycleviewmodelktx` - 2.9.1 -> 2.9.2 26. `androidx.lifecycle:lifecycleviewmodelsavedstate` - 2.9.1 -> 2.9.2 27. `androidx.lifecycle:lifecycleviewmodelsavedstateandroid` - 2.9.1 -> 2.9.2 28. `androidx.navigation:navigationcommon` - 2.9.1 -> 2.9.2 29. `androidx.navigation:navigationcommonandroid` - 2.9.1 -> 2.9.2 30. `androidx.navigation:navigationcommonktx` - 2.9.1 -> 2.9.2 31. `androidx.navigation:navigationcompose` - 2.9.1 -> 2.9.2 32. `androidx.navigation:navigationcomposeandroid` - 2.9.1 -> 2.9.2 33. `androidx.navigation:navigationfragment` - 2.9.1 -> 2.9.2 34. `androidx.navigation:navigationfragmentktx` - 2.9.1 -> 2.9.2 35. `androidx.navigation:navigationruntime` - 2.9.1 -> 2.9.2 36. `androidx.navigation:navigationruntimeandroid` - 2.9.1 -> 2.9.2 37. `androidx.navigation:navigationruntimektx` - 2.9.1 -> 2.9.2 38. `androidx.navigation:navigationui` - 2.9.1 -> 2.9.2 39. `androidx.navigation:navigationuiktx` - 2.9.1 -> 2.9.2 40. `androidx.privacysandbox.ads:adsadservices` - 1.1.0beta11 -> 1.1.0beta12 41. `androidx.privacysandbox.ads:adsadservicesjava` - 1.1.0beta11 -> 1.1.0beta12 42. `androidx.savedstate:savedstate` - 1.3.0 -> 1.3.1 43. `androidx.savedstate:savedstateandroid` - 1.3.0 -> 1.3.1 44. `androidx.savedstate:savedstatecomposeandroid` - 1.3.0 -> 1.3.1 45. `androidx.savedstate:savedstatektx` - 1.3.0 -> 1.3.1 46. `com.google.android.gms:playservicesosslicenses` - 17.2.0 -> 17.2.1 47. `com.google.android.libraries.places:places` - 4.3.1 -> 4.4.1 Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
Stable Updates 20250714 (#1203) Fixes: #1202 This PR implements the standard stable updates process for Android libraries by running the automated update commands and committing the results. ## Updated Packages 1. `androidx.databinding:databindingadapters` - 8.11.0 → 8.11.1 2. `androidx.databinding:databindingcommon` - 8.11.0 → 8.11.1 3. `androidx.databinding:databindingruntime` - 8.11.0 → 8.11.1 4. `androidx.databinding:viewbinding` - 8.11.0 → 8.11.1 5. `com.google.android.gms:playservicesbase` - 18.7.1 → 18.7.2 6. `com.google.android.gms:playservicestasks` - 18.3.1 → 18.3.2 7. `com.google.errorprone:error_prone_annotations` - 2.39.0 → 2.40.0 8. `com.google.errorprone:error_prone_type_annotations` - 2.39.0 → 2.40.0 9. `com.google.firebase:firebaseannotations` - 16.2.0 → 17.0.0 10. `com.google.firebase:firebasecommon` - 21.0.0 → 22.0.0 11. `com.google.firebase:firebasecomponents` - 18.0.1 → 19.0.0 ## Files Modified - `config.json` - Updated Maven artifact versions (26 lines changed) - `cgmanifest.json` - Updated component governance manifest - `docs/artifact-list.md` - Updated artifact documentation - `docs/artifact-list-with-versions.md` - Updated versioned artifact documentation This update includes 11 package version bumps across AndroidX DataBinding, Google Play Services, Error Prone, and Firebase components. All changes are automatically generated updates to the latest stable versions following the standard weekly update process. Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com> Co-authored-by: sheiksyedm <sheiksyedm@syncfusion.com>
Stable Updates 20250708 (#1200) Fixes: #1199 This PR implements the weekly stable updates for July 8, 2025, updating Android library bindings to their latest stable versions. ## Changes Made The following commands were executed as specified in the issue: 1. `dotnet cake -t:update-config` - Updated Maven artifact versions in config.json 2. `dotnet cake utilities.cake -t=generate-component-governance` - Generated component governance manifest 3. `dotnet cake utilities.cake -t=generate-namespace-file` - Updated namespace files 4. `dotnet cake utilities.cake -t=list-artifacts` - Updated artifact lists ## Package Updates (34 total) 1. `androidx.mediarouter:mediarouter` - 1.8.0 → 1.8.1 2. `androidx.navigation:navigationcommon` - 2.9.0 → 2.9.1 3. `androidx.navigation:navigationcommonandroid` - 2.9.0 → 2.9.1 4. `androidx.navigation:navigationcommonktx` - 2.9.0 → 2.9.1 5. `androidx.navigation:navigationcompose` - 2.9.0 → 2.9.1 6. `androidx.navigation:navigationcomposeandroid` - 2.9.0 → 2.9.1 7. `androidx.navigation:navigationfragment` - 2.9.0 → 2.9.1 8. `androidx.navigation:navigationfragmentktx` - 2.9.0 → 2.9.1 9. `androidx.navigation:navigationruntime` - 2.9.0 → 2.9.1 10. `androidx.navigation:navigationruntimeandroid` - 2.9.0 → 2.9.1 11. `androidx.navigation:navigationruntimektx` - 2.9.0 → 2.9.1 12. `androidx.navigation:navigationui` - 2.9.0 → 2.9.1 13. `androidx.navigation:navigationuiktx` - 2.9.0 → 2.9.1 14. `com.android.billingclient:billing` - 7.1.1 → 8.0.0 15. `com.google.ai.edge.litert:litert` - 1.3.0 → 1.4.0 16. `com.google.ai.edge.litert:litertapi` - 1.3.0 → 1.4.0 17. `com.google.ai.edge.litert:litertgpu` - 1.3.0 → 1.4.0 18. `com.google.ai.edge.litert:litertgpuapi` - 1.3.0 → 1.4.0 19. `com.google.ai.edge.litert:litertmetadata` - 1.3.0 → 1.4.0 20. `com.google.ai.edge.litert:litertsupport` - 1.3.0 → 1.4.0 21. `com.google.ai.edge.litert:litertsupportapi` - 1.3.0 → 1.4.0 22. `com.google.android.gms:playservicesbase` - 18.7.0 → 18.7.1 23. `com.google.android.gms:playservicesbasement` - 18.7.0 → 18.7.1 24. `com.google.android.gms:playservicesosslicenses` - 17.1.0 → 17.2.0 25. `com.google.android.gms:playservicestasks` - 18.3.0 → 18.3.1 26. `com.squareup.okhttp3:logginginterceptor` - 4.12.0 → 5.1.0 27. `com.squareup.okhttp3:okhttp` - 4.12.0 → 5.1.0 28. `com.squareup.okhttp3:okhttpbrotli` - 4.12.0 → 5.1.0 29. `com.squareup.okhttp3:okhttptls` - 4.12.0 → 5.1.0 30. `com.squareup.okhttp3:okhttpurlconnection` - 4.12.0 → 5.1.0 31. `com.squareup.okio:okio` - 3.14.0 → 3.15.0 32. `com.squareup.okio:okiojvm` - 3.14.0 → 3.15.0 33. `io.reactivex.rxjava3:rxjava` - 3.1.10 → 3.1.11 34. `org.checkerframework:checkerqual` - 3.49.4 → 3.49.5 This update includes notable version bumps for: - **AndroidX Navigation** libraries (2.9.0 → 2.9.1) - Bug fixes and stability improvements - **Google Billing Client** (7.1.1 → 8.0.0) - Major version update with new billing features - **OkHttp3** libraries (4.12.0 → 5.1.0) - Major version update with performance improvements - **Google AI Edge LiteRT** libraries (1.3.0 → 1.4.0) - AI/ML runtime improvements Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com> Co-authored-by: sheiksyedm <sheiksyedm@syncfusion.com> Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
PreviousNext