dotnet / android-libraries

.NET for Android bindings for Google's libraries, such as AndroidX, GooglePlayServices, Firebase, and MLKit and their 3rd party dependency libraries.
MIT License
235 stars 50 forks source link

Bind "androidx.health:health-services-client" #825

Closed DevronB closed 3 months ago

DevronB commented 11 months ago

Description

package link: https://maven.google.com/web/index.html?q=health#androidx.health:health-services-client:1.0.0-rc01

Although it's RC, it says 'Production Ready', and it looks like it's in continual development and for some reason never gets to release... so I assume it's stable enough for binding?

The problem we have is that Samsung are cripling foreground services and access to location and health data on Wear OS without consuming via this library. I have a fitness app in the Play Store for Wear OS written in net8-android and with out this it's slowly being crippled, which makes dotnet dev for WearOS unviable.

moljac commented 11 months ago

Thanks for the feedback.

Although it's RC, it says 'Production Ready', and it looks like it's in continual development and for some reason never gets to release... so I assume it's stable enough for binding?

😄 "production ready" is quite elastic term. Previews are stable enough for bindings. It is not about stability, but resources (where I live day is 24 hrs too)

The problem we have is that Samsung are cripling foreground services and access to location and health data on Wear OS without consuming via this library.

I get you, but cannot promise anything.

I have a fitness app in the Play Store for Wear OS written in net8-android and with out this it's slowly being crippled, which makes dotnet dev for WearOS unviable.

Which app if I may know? I work on such app myself as a side project and when I find some time and that is - rarely.

DevronB commented 11 months ago

Thanks, @moljac

Yes, this is a part time project for me too.

https://play.google.com/store/apps/details?id=com.limegreenv.geartracker

What is your app, is it written in dotnet? is it in the store? Do you have a link? I'm also interested 😉

Thanks

moljac commented 11 months ago

Thanks, @moljac

You are welcome.

https://play.google.com/store/apps/details?id=com.limegreenv.geartracker

Cool I will check it.

What is your app, is it written in dotnet?

Currently it is several appsand yes in .NET (Xamarin.Forms and now rewriting in MAUI). I was simply solving some problems when I was coaching my daughters. I was skiing coach.

Lara Cvjetko

https://www.ijf.org/judoka/29418

https://www.ijf.org/wrl?category=12

https://www.ijf.org/wrl_olympic?category=12

Nina

https://www.ijf.org/judoka/48861

Jana

https://www.ijf.org/judoka/64009

One of the apps was similar your app. Basic activity tracker, but I have some morphologic/anthropometric (not only) calculations too (BMI, Ponderal index,... Somatotype).

Another app was for Somatotype and even ML.net. I did research paper on that.

https://www.researchgate.net/publication/336228929_Comparison_of_Machine_Learning_Algorithms_for_Somatotype_Classification

https://pdfs.semanticscholar.org/c78b/43ee7415b047b1d78bde519a1300819a6b2b.pdf

https://www.scitepress.org/PublishedPapers/2019/83680/pdf/index.html

Then one is of periodization (planing and programming) app. Actually data (competitions) in CSV + algorithm as console app.

I dream to merge those apps into one and publish it.

is it in the store?

No. I wish.

Do you have a link? I'm also interested 😉

It is in private repo on gitlab. Here is smaller part public, but it is mess...

https://github.com/HolisticWare-Applications/Ph4ct3x

Even readme is centuries old. I think some apps might be there. Not sure anymore. Now I am sad/angry. I must clean that up.

Thanks

DevronB commented 11 months ago

Oh nice, you do have a lot going on! I'm sure there's still plenty of spare time for bindings though, just cut back on some sleep 😉

aritchie commented 11 months ago

This is actually going to become pretty big. Many health and study research programs are out there evaluating these projects right now.

This particular package is pure kotlin with many generics which has made it tough to bind.

@Redth This was package I've been talking about

moljac commented 10 months ago

PR in progress

https://github.com/xamarin/AndroidX/pull/835

aritchie commented 10 months ago

Hey @moljac - The binding does generate, but the connect client uses a bunch of kotlin generics which only translate to Java.Lang.Object on the .NET side. This was causing all sorts of issues in my binding and seems to be an issue with yours as well.

moljac commented 10 months ago

The binding does generate, but the connect client uses a bunch of kotlin generics which only translate to Java.Lang.Object on the .NET side.

True.

This was causing all sorts of issues in my binding and seems to be an issue with yours as well.

What kind of issues?

Not sure if I will have resources (time) to do manual interventions. And yes this is the drawback of our tooling.

aritchie commented 10 months ago

What kind of issues?

I can't get it to cast to equivalent type, so I can work with the actual data. I can get more concrete examples.

Not sure if I will have resources (time) to do manual interventions. And yes this is the drawback of our tooling.

You don't need to quote this for my benefit. I've been around the Xamarin community long enough to know the underfunding going on. My point about this is that if the binding doesn't provide the necessary functionality, you'll be dealing with more support issues downstream.

aritchie commented 10 months ago

@moljac Try doing a ReadRecords off a IHealthConnectClient. I can't find an implementation of IContinuation for kotlin in the stdlib. How do you create a read request as the class is marked abstract?

I got my binding a little farther along with "new ReadRecordsRequest(IKClass, filter, null, true, 2000, "")" but there doesn't seem to be a way get IKClass. The implementation is large and likely not something we're suppose to implement anyhow.

I appreciate that timing isn't on your side, but this binding doesn't appear to actually be in a usable state.

DevronB commented 10 months ago

Screenshot_20240126_164936_Outlook.jpg

moljac commented 9 months ago

@aritchie

https://github.com/xamarin/AndroidX/pull/835#issuecomment-1937675158

This is why binding previews is no fun. Google moves types in released artifacts and that causes troubles. This is worse.

moljac commented 9 months ago

@moljac Try doing a ReadRecords off a IHealthConnectClient. I can't find an implementation of IContinuation for kotlin in the stdlib.

Again I am not SDK API expert.

generated/org.jetbrains.kotlin.kotlin-stdlib/obj/Release/net7.0-android/generated/src/Kotlin.Coroutines.IContinuation.cs
generated/org.jetbrains.kotlin.kotlin-stdlib/obj/Release/net6.0-android/generated/src/Kotlin.Coroutines.IContinuation.cs
generated/org.jetbrains.kotlin.kotlin-stdlib/obj/Release/monoandroid12.0/generated/src/Kotlin.Coroutines.IContinuation.cs

How do you create a read request as the class is marked abstract?

Doesn't inheriting/extending/subclassing/specializing abstract class, implementing abstract stuff and adding behavior work?

I got my binding a little farther along with "new ReadRecordsRequest(IKClass, filter, null, true, 2000, "")" but there doesn't seem to be a way get IKClass. The implementation is large and likely not something we're suppose to implement anyhow.

generated/org.jetbrains.kotlin.kotlin-stdlib/obj/Release/net7.0-android/generated/src/Kotlin.Reflect.IKClass.cs
generated/org.jetbrains.kotlin.kotlin-stdlib/obj/Release/net6.0-android/generated/src/Kotlin.Reflect.IKClass.cs
generated/org.jetbrains.kotlin.kotlin-stdlib/obj/Release/monoandroid12.0/generated/src/Kotlin.Reflect.IKClass.cs

I appreciate that timing isn't on your side, but this binding doesn't appear to actually be in a usable state.

DevronB commented 9 months ago

We're did this end up? Is there a binding that can be released soon?

moljac commented 9 months ago

We're did this end up?

Well there are issues with build. Those packages revealed some new fun stuff.

Is there a binding that can be released soon?

Nugets are built. Not sure if those are accessible from public/outside.

Even when everything is green I am not sure that packages will be published.

DevronB commented 9 months ago

hmmm, what does this mean as far as timing/availability?

DevronB commented 8 months ago

If the bindings are getting this hard, where does this leave cross platform development using dotnet?

What's the MS model for making bindings, is it supported internally or is it left to the end users/contributors?

Any update on whether this will get over the line anytime soon?

Sorry for my ignorance, but when I set out to use dotnet-android on my project I assumed I'd be able to use third party libraries with minimal effort.

Thanks again, just looking to see where things stand.

moljac commented 8 months ago

hmmm, what does this mean as far as timing/availability?

Not sure. Trying to do my best to juggle all my tasks. These bindings introduced new issues and trying to solve them.

moljac commented 8 months ago

If the bindings are getting this hard, where does this leave cross platform development using dotnet?

To answer 1st part: not all bindings are that hard. Some are. Check androidx.media3 PR.

To answer 2nd part: Well I am certainly not the one to answer that.

What's the MS model for making bindings, is it supported internally or is it left to the end users/contributors?

We have constant discussion about that. Xamarin.Components repo is maintained only if special request comes in. All dependencies are in AX and GPS-FB-MLKit, all together 600+ packages.

PRs and contributions are welcome.

Any update on whether this will get over the line anytime soon?

I hope so.

In androidx.media3 PR some comments reveal that we did some design errors (assumption errors), but it is not only us. Google's ecosystem is live and their teams are human and make mistakes, so they do workarounds. One workaround that was present for quite long in AX/GPS-FB-MLKit and that is that some of their packages have dependencies on some old maven artifacts and they are packaged in AAR as repackaged.jar. There was only 1 (in androidx.emoji) and androidx.health brought in 2 more, so right now we have conflicts in the sample apps.

Sorry for my ignorance, but when I set out to use dotnet-android on my project I assumed I'd be able to use third party libraries with minimal effort.

Rethorical question: size of the set called 3rd party libraries (in mathemartical sense) would be? Where do we draw the line?

Thanks again, just looking to see where things stand.

You are welcome.

Even when this PR is done. It will not be merged, because it is in preview and internal builds do not have nuget feeds where users could test preview packages. So you'll have to at least build it locally.

THanks.

DevronB commented 8 months ago

Thanks for the update, it sounds like you have a lot on your hands.

Should I build locally now, or wait until these isdues have been resolved? I.e. Will it work?

moljac commented 8 months ago

Thanks for the update, it sounds like you have a lot on your hands.

Tons. We had issues with nuget filesizes on nuget.org (nuget gallery). It is solved now, so I'll be working on this PR soon.

Should I build locally now, or wait until these isdues have been resolved? I.e. Will it work?

Will it work? Maybe with probability closer to No. If you can check which packages must be bound maybe you could exclude those extras that cause issues until I implement the fix.

DevronB commented 8 months ago

Thank you, I'll wait patiently 👍

moljac commented 8 months ago

Thank you, I'll wait patiently 👍

Sheat. Now I got guilt feeling and I am not being sarcastic. I'll do my best to fix it ASAP.

DevronB commented 7 months ago

Any news? With the upcommig Wear OS 5 and fitness/health apps being the main reason most ppl buy Wear OS wearables and apps.... and, this lib is optimised for better battery life

DevronB commented 6 months ago

@moljac, any progress?

moljac commented 6 months ago

@moljac, any progress?

A bit. We removed classic support and I am stuck with regular updates and new issues with R8.

In this PR https://github.com/xamarin/AndroidX/pull/835

I have bound 3 health artifacts from 2 groupIds

As I am not being SDK expert it seems to me like some might be deprecated, but there is no notice (or I did not find any yet), so when adding nugets to app during test I get tons of ACW errors with duplicate/multiply-defined classes.

Seems like

https://maven.google.com/web/index.html?q=health#androidx.health:health-connect-client

might be deprecated.

Error:

/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.platform.client.impl.sdkservice.IGetIsInForegroundCallback` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.platform.client.impl.sdkservice.IGetIsInForegroundCallback` generated by: AndroidX.Health.Platform.Client.Impl.Sdkservice.IGetIsInForegroundCallback, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.platform.client.impl.sdkservice.IGetIsInForegroundCallback` generated by: AndroidX.Health.Platform.Client.Impl.Sdkservice.IGetIsInForegroundCallback, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.platform.client.impl.sdkservice.IGetPermissionTokenCallback` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.platform.client.impl.sdkservice.IGetPermissionTokenCallback` generated by: AndroidX.Health.Platform.Client.Impl.Sdkservice.IGetPermissionTokenCallback, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.platform.client.impl.sdkservice.IGetPermissionTokenCallback` generated by: AndroidX.Health.Platform.Client.Impl.Sdkservice.IGetPermissionTokenCallback, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.platform.client.impl.sdkservice.IHealthDataSdkService` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.platform.client.impl.sdkservice.IHealthDataSdkService` generated by: AndroidX.Health.Platform.Client.Impl.Sdkservice.IHealthDataSdkServiceInterface, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.platform.client.impl.sdkservice.IHealthDataSdkService` generated by: AndroidX.Health.Platform.Client.Impl.Sdkservice.IHealthDataSdkServiceInterface, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.platform.client.impl.sdkservice.ISetPermissionTokenCallback` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.platform.client.impl.sdkservice.ISetPermissionTokenCallback` generated by: AndroidX.Health.Platform.Client.Impl.Sdkservice.ISetPermissionTokenCallback, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.platform.client.impl.sdkservice.ISetPermissionTokenCallback` generated by: AndroidX.Health.Platform.Client.Impl.Sdkservice.ISetPermissionTokenCallback, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.platform.client.impl.ipc.RemoteFutureOperation` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.platform.client.impl.ipc.RemoteFutureOperation` generated by: AndroidX.Health.Platform.Client.Impl.Ipc.IRemoteFutureOperation, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.platform.client.impl.ipc.RemoteFutureOperation` generated by: AndroidX.Health.Platform.Client.Impl.Ipc.IRemoteFutureOperation, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.platform.client.impl.ipc.RemoteOperation` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.platform.client.impl.ipc.RemoteOperation` generated by: AndroidX.Health.Platform.Client.Impl.Ipc.IRemoteOperation, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.platform.client.impl.ipc.RemoteOperation` generated by: AndroidX.Health.Platform.Client.Impl.Ipc.IRemoteOperation, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.platform.client.impl.ipc.ServiceOperation` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.platform.client.impl.ipc.ServiceOperation` generated by: AndroidX.Health.Platform.Client.Impl.Ipc.IServiceOperation, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.platform.client.impl.ipc.ServiceOperation` generated by: AndroidX.Health.Platform.Client.Impl.Ipc.IServiceOperation, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.platform.client.impl.ipc.internal.ExecutionTracker` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.platform.client.impl.ipc.internal.ExecutionTracker` generated by: AndroidX.Health.Platform.Client.Impl.Ipc.Internal.IExecutionTracker, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.platform.client.impl.ipc.internal.ExecutionTracker` generated by: AndroidX.Health.Platform.Client.Impl.Ipc.Internal.IExecutionTracker, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.platform.client.impl.ipc.internal.QueueOperation` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.platform.client.impl.ipc.internal.QueueOperation` generated by: AndroidX.Health.Platform.Client.Impl.Ipc.Internal.IQueueOperation, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.platform.client.impl.ipc.internal.QueueOperation` generated by: AndroidX.Health.Platform.Client.Impl.Ipc.Internal.IQueueOperation, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.platform.client.impl.ipc.internal.ServiceConnection$Callback` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.platform.client.impl.ipc.internal.ServiceConnection$Callback` generated by: AndroidX.Health.Platform.Client.Impl.Ipc.Internal.ServiceConnection+ICallback, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.platform.client.impl.ipc.internal.ServiceConnection$Callback` generated by: AndroidX.Health.Platform.Client.Impl.Ipc.Internal.ServiceConnection+ICallback, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.platform.client.error.ErrorCode` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.platform.client.error.ErrorCode` generated by: AndroidX.Health.Platform.Client.Error.IErrorCode, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.platform.client.error.ErrorCode` generated by: AndroidX.Health.Platform.Client.Error.IErrorCode, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.connect.client.HealthConnectClient` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.HealthConnectClient` generated by: AndroidX.Health.Connect.Client.IHealthConnectClient, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.HealthConnectClient` generated by: AndroidX.Health.Connect.Client.IHealthConnectClient, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.connect.client.PermissionController` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.PermissionController` generated by: AndroidX.Health.Connect.Client.IPermissionController, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.PermissionController` generated by: AndroidX.Health.Connect.Client.IPermissionController, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.connect.client.records.BloodGlucoseRecord$SpecimenSources` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.records.BloodGlucoseRecord$SpecimenSources` generated by: AndroidX.Health.Connect.Client.Records.BloodGlucoseRecord+ISpecimenSources, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.records.BloodGlucoseRecord$SpecimenSources` generated by: AndroidX.Health.Connect.Client.Records.BloodGlucoseRecord+ISpecimenSources, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.connect.client.records.BloodPressureRecord$MeasurementLocations` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.records.BloodPressureRecord$MeasurementLocations` generated by: AndroidX.Health.Connect.Client.Records.BloodPressureRecord+IMeasurementLocations, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.records.BloodPressureRecord$MeasurementLocations` generated by: AndroidX.Health.Connect.Client.Records.BloodPressureRecord+IMeasurementLocations, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.connect.client.records.CervicalMucusRecord$Appearances` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.records.CervicalMucusRecord$Appearances` generated by: AndroidX.Health.Connect.Client.Records.CervicalMucusRecord+IAppearances, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.records.CervicalMucusRecord$Appearances` generated by: AndroidX.Health.Connect.Client.Records.CervicalMucusRecord+IAppearances, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.connect.client.records.CervicalMucusRecord$Sensations` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.records.CervicalMucusRecord$Sensations` generated by: AndroidX.Health.Connect.Client.Records.CervicalMucusRecord+ISensations, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.records.CervicalMucusRecord$Sensations` generated by: AndroidX.Health.Connect.Client.Records.CervicalMucusRecord+ISensations, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.connect.client.records.ExerciseSessionRecord$ExerciseTypes` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.records.ExerciseSessionRecord$ExerciseTypes` generated by: AndroidX.Health.Connect.Client.Records.ExerciseSessionRecord+IExerciseTypes, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.records.ExerciseSessionRecord$ExerciseTypes` generated by: AndroidX.Health.Connect.Client.Records.ExerciseSessionRecord+IExerciseTypes, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.connect.client.records.BodyTemperatureMeasurementLocations` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.records.BodyTemperatureMeasurementLocations` generated by: AndroidX.Health.Connect.Client.Records.IBodyTemperatureMeasurementLocations, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.records.BodyTemperatureMeasurementLocations` generated by: AndroidX.Health.Connect.Client.Records.IBodyTemperatureMeasurementLocations, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.connect.client.records.MealTypes` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.records.MealTypes` generated by: AndroidX.Health.Connect.Client.Records.IMealTypes, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.records.MealTypes` generated by: AndroidX.Health.Connect.Client.Records.IMealTypes, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.connect.client.records.Record` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.records.Record` generated by: AndroidX.Health.Connect.Client.Records.IRecord, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.records.Record` generated by: AndroidX.Health.Connect.Client.Records.IRecord, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.connect.client.records.OvulationTestRecord$Results` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.records.OvulationTestRecord$Results` generated by: AndroidX.Health.Connect.Client.Records.OvulationTestRecord+IResults, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.records.OvulationTestRecord$Results` generated by: AndroidX.Health.Connect.Client.Records.OvulationTestRecord+IResults, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.connect.client.records.SexualActivityRecord$Protections` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.records.SexualActivityRecord$Protections` generated by: AndroidX.Health.Connect.Client.Records.SexualActivityRecord+IProtections, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.records.SexualActivityRecord$Protections` generated by: AndroidX.Health.Connect.Client.Records.SexualActivityRecord+IProtections, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.connect.client.records.SleepStageRecord$StageTypes` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.records.SleepStageRecord$StageTypes` generated by: AndroidX.Health.Connect.Client.Records.SleepStageRecord+IStageTypes, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.records.SleepStageRecord$StageTypes` generated by: AndroidX.Health.Connect.Client.Records.SleepStageRecord+IStageTypes, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.connect.client.records.Vo2MaxRecord$MeasurementMethods` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.records.Vo2MaxRecord$MeasurementMethods` generated by: AndroidX.Health.Connect.Client.Records.Vo2MaxRecord+IMeasurementMethods, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.records.Vo2MaxRecord$MeasurementMethods` generated by: AndroidX.Health.Connect.Client.Records.Vo2MaxRecord+IMeasurementMethods, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.connect.client.changes.Change` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.changes.Change` generated by: AndroidX.Health.Connect.Client.Changes.IChange, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.changes.Change` generated by: AndroidX.Health.Connect.Client.Changes.IChange, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215: The Java type `androidx.health.connect.client.permission.AccessType` is generated by more than one managed type. Please change the [Register] attribute so that the same Java type is not emitted. [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.permission.AccessType` generated by: AndroidX.Health.Connect.Client.Permission.IAccessType, Xamarin.AndroidX.Health.Connect.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/33.0.95/tools/Xamarin.Android.Common.targets(1476,3): error XA4215:   `androidx.health.connect.client.permission.AccessType` generated by: AndroidX.Health.Connect.Client.Permission.IAccessType, Xamarin.AndroidX.Health.ConnectClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [./samples/dotnet/BuildAllDotNet/BuildAllDotNet.csproj::TargetFramework=net7.0-android]
    55 Warning(s)
    81 Error(s)
DevronB commented 6 months ago

is this of use?

https://developer.android.com/jetpack/androidx/releases/health#1.0.0-alpha03

image
moljac commented 6 months ago

yup

It would be nice to have such comment here:

https://maven.google.com/web/index.html?q=androidx.health

or at least metadata Deprecated=true.

DevronB commented 6 months ago

are we close?

:-)

moljac commented 6 months ago

are we close?

:-)

Not sure...

https://github.com/xamarin/AndroidX/pull/835#issuecomment-2137330314

DevronB commented 5 months ago

Is there anything I can do to assist?

moljac commented 5 months ago

are we close?

:-)

Morn. Everything is ready, but CI has some issues with the samples. Not sure what is going on.

just FYI

EagleDelux commented 5 months ago

Will this work for .net maui also or is it just for xamarin?

moljac commented 5 months ago

Will this work for .net maui also or is it just for xamarin?

MAUI is continuation/evolution of Xamarin, so it will work with MAUI. TFMs change (net8.0), but that would change for Xamarin too.

EagleDelux commented 5 months ago

I hope this help somone else because it was a pain to figgure out! First make sure you update all your nugets to latest version and check if the error message goes away. That did not work for me at the current time but might work in the future. I got this error:

java.exe error JAVA0000: Error in C:\Users\yrien\.nuget\packages\xamarin.androidx.collection.jvm\1.4.0.4\buildTransitive\net8.0-android34.0\..\..\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArraySetKt.class:
1>MSBUILD : java.exe error JAVA0000: Type androidx.collection.ArraySetKt is defined multiple times: C:\Users\yrien\.nuget\packages\xamarin.androidx.collection.jvm\1.4.0.4\buildTransitive\net8.0-android34.0\..\..\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArraySetKt.class, C:\Users\yrien\.nuget\packages\xamarin.androidx.collection.ktx\1.2.0.9\buildTransitive\net6.0-android31.0\..\..\jar\androidx.collection.collection-ktx.jar:androidx/collection/ArraySetKt.class
1>MSBUILD : java.exe error JAVA0000: Compilation failed
Xamarin.AndroidX.Health.Connect.ConnectClient 1.0.0-alpha11 -> Xamarin.AndroidX.Activity 1.9.0.3 -> Xamarin.AndroidX.Collection 1.4.0.5 -> Xamarin.AndroidX.Collection.Jvm (>= 1.4.0.4)

Microsoft.Maui.Controls.Compatibility 8.0.21 -> Microsoft.Maui.Controls.Xaml 8.0.21 -> Microsoft.Maui.Core 8.0.21 -> Xamarin.AndroidX.Navigation.Fragment 2.6.0.1 -> Xamarin.AndroidX.Fragment.Ktx 1.6.0.1 -> Xamarin.AndroidX.Collection.Ktx (>= 1.2.0.9)
Microsoft.Maui.Controls.Compatibility 8.0.21 -> Microsoft.Maui.Controls.Core 8.0.21 -> Microsoft.Maui.Core 8.0.21 -> Xamarin.AndroidX.Navigation.Fragment 2.6.0.1 -> Xamarin.AndroidX.Fragment.Ktx 1.6.0.1 -> Xamarin.AndroidX.Collection.Ktx (>= 1.2.0.9)
Microsoft.Maui.Controls 8.0.21 -> Microsoft.Maui.Controls.Xaml 8.0.21 -> Microsoft.Maui.Core 8.0.21 -> Xamarin.AndroidX.Navigation.Fragment 2.6.0.1 -> Xamarin.AndroidX.Fragment.Ktx 1.6.0.1 -> Xamarin.AndroidX.Collection.Ktx (>= 1.2.0.9)
Microsoft.Maui.Controls 8.0.21 -> Microsoft.Maui.Controls.Core 8.0.21 -> Microsoft.Maui.Core 8.0.21 -> Xamarin.AndroidX.Navigation.Fragment 2.6.0.1 -> Xamarin.AndroidX.Fragment.Ktx 1.6.0.1 -> Xamarin.AndroidX.Collection.Ktx (>= 1.2.0.9)
Microsoft.Maui.Controls.Compatibility 8.0.21 -> Microsoft.Maui.Controls.Xaml 8.0.21 -> Microsoft.Maui.Core 8.0.21 -> Xamarin.AndroidX.Navigation.Common 2.6.0.1 -> Xamarin.AndroidX.Collection.Ktx (>= 1.2.0.9)
Microsoft.Maui.Controls.Compatibility 8.0.21 -> Microsoft.Maui.Controls.Core 8.0.21 -> Microsoft.Maui.Core 8.0.21 -> Xamarin.AndroidX.Navigation.Common 2.6.0.1 -> Xamarin.AndroidX.Collection.Ktx (>= 1.2.0.9)
Microsoft.Maui.Controls 8.0.21 -> Microsoft.Maui.Controls.Xaml 8.0.21 -> Microsoft.Maui.Core 8.0.21 -> Xamarin.AndroidX.Navigation.Common 2.6.0.1 -> Xamarin.AndroidX.Collection.Ktx (>= 1.2.0.9)
Microsoft.Maui.Controls 8.0.21 -> Microsoft.Maui.Controls.Core 8.0.21 -> Microsoft.Maui.Core 8.0.21 -> Xamarin.AndroidX.Navigation.Common 2.6.0.1 -> Xamarin.AndroidX.Collection.Ktx (>= 1.2.0.9)

Since ArraySetKt.class had moved from Xamarin.AndroidX.Collection.Ktx to Xamarin.AndroidX.Collection.Jvm between version 1.2.0.9 and 1.4.0.4.

You need to explicit set Xamarin.AndroidX.Collection.Jvm and Xamarin.AndroidX.Collection.Ktx (so they match same versions). I set them to the lates version.

<PackageReference Include="Xamarin.AndroidX.Collection.Jvm" Version="1.4.0.4" />
<PackageReference Include="Xamarin.AndroidX.Collection.Ktx" Version="1.4.0.4" />

Then I got the following error: java.exe error JAVA0000: Type androidx.activity.ActivityViewModelLazyKt$viewModels$1 is defined multiple times: obj\Debug\net8.0-android\lp\112\jl\classes.jar:androidx/activity/ActivityViewModelLazyKt$viewModels$1.class, obj\Debug\net8.0-android\lp\143\jl\classes.jar:androidx/activity/ActivityViewModelLazyKt$viewModels$1.class

Xamarin.AndroidX.Health.Connect.ConnectClient 1.0.0-alpha11 -> Xamarin.AndroidX.Activity (>= 1.9.0.3)

Microsoft.Maui.Controls 8.0.21 -> Microsoft.Maui.Controls.Core 8.0.21 -> Microsoft.Maui.Core 8.0.21 -> Xamarin.AndroidX.Navigation.Runtime 2.6.0.1 -> Xamarin.AndroidX.Activity.Ktx (>= 1.7.2.1) 
Microsoft.Maui.Controls 8.0.21 -> Microsoft.Maui.Controls.Xaml 8.0.21 -> Microsoft.Maui.Core 8.0.21 -> Xamarin.AndroidX.Navigation.Runtime 2.6.0.1 -> Xamarin.AndroidX.Activity.Ktx (>= 1.7.2.1)
Microsoft.Maui.Controls.Compatibility 8.0.21 -> Microsoft.Maui.Controls.Core 8.0.21 -> Microsoft.Maui.Core 8.0.21 -> Xamarin.AndroidX.Navigation.Runtime 2.6.0.1 -> Xamarin.AndroidX.Activity.Ktx (>= 1.7.2.1)
Microsoft.Maui.Controls.Compatibility 8.0.21 -> Microsoft.Maui.Controls.Xaml 8.0.21 -> Microsoft.Maui.Core 8.0.21 -> Xamarin.AndroidX.Navigation.Runtime 2.6.0.1 -> Xamarin.AndroidX.Activity.Ktx (>= 1.7.2.1)
Microsoft.Maui.Controls 8.0.21 -> Microsoft.Maui.Controls.Core 8.0.21 -> Microsoft.Maui.Core 8.0.21 -> Xamarin.AndroidX.Navigation.Fragment 2.6.0.1 -> Xamarin.AndroidX.Fragment.Ktx 1.6.0.1 -> Xamarin.AndroidX.Activity.Ktx (>= 1.7.2.1)
Microsoft.Maui.Controls 8.0.21 -> Microsoft.Maui.Controls.Xaml 8.0.21 -> Microsoft.Maui.Core 8.0.21 -> Xamarin.AndroidX.Navigation.Fragment 2.6.0.1 -> Xamarin.AndroidX.Fragment.Ktx 1.6.0.1 -> Xamarin.AndroidX.Activity.Ktx (>= 1.7.2.1)
Microsoft.Maui.Controls.Compatibility 8.0.21 -> Microsoft.Maui.Controls.Core 8.0.21 -> Microsoft.Maui.Core 8.0.21 -> Xamarin.AndroidX.Navigation.Fragment 2.6.0.1 -> Xamarin.AndroidX.Fragment.Ktx 1.6.0.1 -> Xamarin.AndroidX.Activity.Ktx (>= 1.7.2.1)
Microsoft.Maui.Controls.Compatibility 8.0.21 -> Microsoft.Maui.Controls.Xaml 8.0.21 -> Microsoft.Maui.Core 8.0.21 -> Xamarin.AndroidX.Navigation.Fragment 2.6.0.1 -> Xamarin.AndroidX.Fragment.Ktx 1.6.0.1 -> Xamarin.AndroidX.Activity.Ktx (>= 1.7.2.1)

Since type androidx.activity.ActivityViewModelLazyKt$viewModels$1 had moved from Xamarin.AndroidX.Activity.Ktx to Xamarin.AndroidX.Activity between version 1.7.2.1 and 1.9.0.3

You need to explicit set Xamarin.AndroidX.Activity and Xamarin.AndroidX.Activity.Ktx (so they match same versions). I set them to the lates version.

<PackageReference Include="Xamarin.AndroidX.Activity" Version="1.9.0.3" />
<PackageReference Include="Xamarin.AndroidX.Activity.Ktx" Version="1.9.0.3" />
EagleDelux commented 5 months ago

Binding library need to be updated to lates version. I have tested it now but it will not work. Here screenshot of error from health connect app when I ask for permission. Error message in english : Health (app name) must update to continue syncing with health connect. image

1.1.0-alpha07 [1.1.0-alpha07]. I tried to begin fixing the binding library but changing 1.0.0-alpha11 to 1.1.0-alpha07 in config.json and cgmanifest.json but AndroidBinderator still downloads 1.0.0-alpha11. Why is that?

EagleDelux commented 5 months ago

I have manged to bumped androidx.health.connect to 1.1.0-alpha07 and created a pull request for it. https://github.com/xamarin/AndroidX/pull/919

Also tested it and managed to ask for permission and aggregated health data. If anyone is intrested to see how I did it publish it to Github. It is not easy to work with so hopfully this will help you on the way. https://github.com/EagleDelux/androidx.health-connect-demo-.net-maui

DevronB commented 4 months ago

I ended up building this locally and referencing the output nugets as a local nuget source. All seemed to build ok when including: <PackageReference Include="Xamarin.AndroidX.Health.Connect.ConnectClient" Version="1.1.0-alpha07" />

but when referencing: <PackageReference Include="Xamarin.AndroidX.Health.ServicesClient" Version="1.0.0-rc02" />

I get these errors on build, any ideas?

C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: C:\Repos\App\obj\Release\net8.0-android\lp\131\jl\AndroidManifest.xml Warning: [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: Namespace 'com.android.billingclient' used in: AndroidManifest.xml, AndroidManifest.xml. [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: C:\Repos\App\obj\Release\net8.0-android\lp\140\jl\AndroidManifest.xml Warning: [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: Namespace 'com.google.android.gms.base' used in: AndroidManifest.xml, AndroidManifest.xml. [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: C:\Repos\App\obj\Release\net8.0-android\lp\134\jl\AndroidManifest.xml Warning: [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: Namespace 'com.google.firebase.encoders.json' used in: AndroidManifest.xml, AndroidManifest.xml. [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: C:\Repos\App\obj\Release\net8.0-android\lp\144\jl\AndroidManifest.xml Warning: [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: Namespace 'com.google.android.gms.wearable' used in: AndroidManifest.xml, AndroidManifest.xml. [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: C:\Repos\App\obj\Release\net8.0-android\lp\141\jl\AndroidManifest.xml Warning: [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: Namespace 'com.google.android.gms.common' used in: AndroidManifest.xml, AndroidManifest.xml. [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: C:\Repos\App\obj\Release\net8.0-android\lp\142\jl\AndroidManifest.xml Warning: [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: Namespace 'com.google.android.gms.location' used in: AndroidManifest.xml, AndroidManifest.xml. [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: C:\Repos\App\obj\Release\net8.0-android\lp\143\jl\AndroidManifest.xml Warning: [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: Namespace 'com.google.android.gms.tasks' used in: AndroidManifest.xml, AndroidManifest.xml. [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: uses-sdk:minSdkVersion 28 cannot be smaller than version 30 declared in library C:\Repos\App\obj\Release\net8.0-android\lp\120\jl\AndroidManifest.xml as the library mi ght be using APIs not available in 28 [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: Suggestion: use a compatible library with a minSdk of at most 28, [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: or increase this project's minSdk version to at least 30, [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: or use tools:overrideLibrary="androidx.health.services.client" to force usage (may lead to runtime failures) [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: Directory 'obj\Release\net8.0-android\lp\131' is from 'billing.aar'. [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: Directory 'obj\Release\net8.0-android\lp\140' is from 'play-services-base.aar'. [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: Directory 'obj\Release\net8.0-android\lp\134' is from 'firebase-encoders-json.aar'. [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: Directory 'obj\Release\net8.0-android\lp\144' is from 'play-services-wearable.aar'. [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: Directory 'obj\Release\net8.0-android\lp\141' is from 'play-services-basement.aar'. [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: Directory 'obj\Release\net8.0-android\lp\142' is from 'play-services-location.aar'. [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: Directory 'obj\Release\net8.0-android\lp\143' is from 'play-services-tasks.aar'. [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: Directory 'obj\Release\net8.0-android\lp\120' is from 'androidx.health.health-services-client.aar'. [C:\Repos\App\App.csproj]

DevronB commented 4 months ago

I bumped to see if it would fix:

image

but now getting errors: C:\Repos\AndroidX\generated\androidx.health.health-services-client\obj\Release\net8.0-android\generated\src\AndroidX.Health.Services.Client.Data.DebouncedDataTypeCondition.cs(282,96): error CS0111: Type 'DebouncedDataTypeCondition' already defines a member called 'CreateDebouncedDataTypeCondition' with the same parameter types [C:\Repos\AndroidX\generated\androidx.health.health-services-client\androidx.health.health-services-client.csproj::TargetFramework=net8.0-android] C:\Repos\AndroidX\generated\androidx.health.health-services-client\obj\Release\net8.0-android\generated\src\AndroidX.Health.Services.Client.Data.DebouncedDataTypeCondition.cs(135,90): error CS0111: Type 'DebouncedDataTypeCondition.Companion' already defines a member called 'CreateDebouncedDataType Condition' with the same parameter types [C:\Repos\AndroidX\generated\androidx.health.health-services-client\androidx.health.health-services-client.csproj::TargetFramework=net8.0-android]

EagleDelux commented 4 months ago

I ended up building this locally and referencing the output nugets as a local nuget source. All seemed to build ok when including: <PackageReference Include="Xamarin.AndroidX.Health.Connect.ConnectClient" Version="1.1.0-alpha07" />

but when referencing: <PackageReference Include="Xamarin.AndroidX.Health.ServicesClient" Version="1.0.0-rc02" />

I tried add this to but my build failed to. I added <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="34" tools:overrideLibrary="androidx.health.connect.client,androidx.health.services.client"/> to AndroidManifest.xml and it build succesfuly. (should maybe instruct not build for android versions lower than what is defined in the library but not sure how you do this. I did't have use for androidx.health.services.client but I can try to bump it to and fix the build errors.

DevronB commented 4 months ago

@EagleDelux, thank you. I was trying to get a build working with the version bump to see if it fixed the error, but am getting the above duplicate method signatures generated. I'm feeling my way around. Some pointers on how to configure to remove the duplicates would be good?

Looking in: AndroidX.Health.Services.Client.Data.DebouncedDataTypeCondition.cs I can see them:

image

But am unsure how to fix this, should one be qualified by chaning the name, I'm not sure...

EagleDelux commented 4 months ago

New pull request #920

        /**
         * Creates a [DebouncedDataTypeCondition] for a sample data type, whose value represents an
         * instantaneous value, e.g. instantaneous heart rate, instantaneous speed.
         *
         * @param dataType a delta data type that is associated with [SampleDataPoint]s, and whose
         *   value represents an instantaneous value
         * @param threshold the threshold for the value of this data type to cross in order to
         *   satisfy the condition
         * @param comparisonType the way that determines how to compare the value of the data type
         *   with the threshold in the condition, e.g. greater than, less than or equal
         * @param initialDelaySeconds the amount of time (in seconds) that must pass before the goal
         *   can trigger. Must be greater or equal to zero
         * @param durationAtThresholdSeconds the amount of time (in seconds) the threshold must be
         *   crossed uninterruptedly for this goal to trigger. Must be greater or equal to zero
         */
        @JvmStatic
        fun <
            T : Number,
            D : DeltaDataType<T, out SampleDataPoint<T>>
        > createDebouncedDataTypeCondition(
            dataType: D,
            threshold: T,
            comparisonType: ComparisonType,
            initialDelaySeconds: Int,
            durationAtThresholdSeconds: Int
        ): DebouncedDataTypeCondition<T, D> =
            DebouncedDataTypeCondition(
                dataType,
                threshold,
                comparisonType,
                initialDelaySeconds,
                durationAtThresholdSeconds
            )

        /**
         * Creates a [DebouncedDataTypeCondition] for an aggregate data type, whose value represents
         * an average value, e.g. average heart rate over the tracking period, average speed over
         * the tracking period.
         *
         * @param dataType an aggregate data type that is associated with [StatisticalDataPoint]s,
         *   and whose value represents an average value over the tracking period
         * @param threshold the threshold for the value of this data type to cross in order to
         *   satisfy the condition
         * @param comparisonType the way that determines how to compare the value of the data type
         *   with the threshold in the condition, e.g. greater than, less than or equal
         * @param initialDelaySeconds the amount of time (in seconds) that must pass before the goal
         *   can trigger. Must be greater or equal to zero
         * @param durationAtThresholdSeconds the amount of time (in seconds) the threshold must be
         *   crossed uninterruptedly for this goal to trigger. Must be greater or equal to zero
         */
        @JvmStatic
        fun <
            T : Number,
            D : AggregateDataType<T, out StatisticalDataPoint<T>>
        > createDebouncedDataTypeCondition(
            dataType: D,
            threshold: T,
            comparisonType: ComparisonType,
            initialDelaySeconds: Int,
            durationAtThresholdSeconds: Int
        ): DebouncedDataTypeCondition<T, D> =
            DebouncedDataTypeCondition(
                dataType,
                threshold,
                comparisonType,
                initialDelaySeconds,
                durationAtThresholdSeconds
            )

When these functions are bound to .NET through Java Interop, the generics and type parameters are not directly represented. Instead, the bindings generate methods based on the Java signatures. The Java equivalents for these Kotlin functions are created by the Kotlin compiler, leading to the following:

Instance Methods: createDebouncedDataTypeCondition for DeltaDataType createDebouncedDataTypeCondition for AggregateDataType Static Methods: createDebouncedDataTypeCondition for DeltaDataType createDebouncedDataTypeCondition for AggregateDataType

I removed the instance methods and renamed the static methods to CreateDebouncedDataTypeConditionForAggregateDataType and CreateDebouncedDataTypeConditionForDeltaDataType because dataType is converted to global::Java.Lang.Object dataType due to the lack of support for Kotlin generics in .NET. This results in the functions having the same parameters and return type, necessitating renaming to distinguish between them.

Renamed Static Methods: CreateDebouncedDataTypeConditionForAggregateDataType CreateDebouncedDataTypeConditionForDeltaDataType

I removed the Instance Methods because they are not needed.

DevronB commented 4 months ago

Great! I'm trying it now...

So I'm clear on how you acheived this, and for future reference:

EagleDelux commented 4 months ago

So I'm clear on how you acheived this, and for future reference:

  • Remove the methods in Metatadata.xml
  • Created the DebouncedDataTypeCondition.cs in source....\Additons
  • Copied the methods from the generated DebouncedDataTypeCondition.cs to source....\Additions\DebouncedDataTypeCondition.cs
  • Manually renamed the methods?

yes that's exactly what I did. Copied the methods from the generated DebouncedDataTypeCondition.cs to source....\Additions\DebouncedDataTypeCondition.cs The reason I did this was because the path was the same for both functions since they had the same return type and parameters so there where no way to change the names from Metadata.xml

moljac commented 4 months ago

I bumped to see if it would fix: image

but now getting errors: C:\Repos\AndroidX\generated\androidx.health.health-services-client\obj\Release\net8.0-android\generated\src\AndroidX.Health.Services.Client.Data.DebouncedDataTypeCondition.cs(282,96): error CS0111: Type 'DebouncedDataTypeCondition' already defines a member called 'CreateDebouncedDataTypeCondition' with the same parameter types [C:\Repos\AndroidX\generated\androidx.health.health-services-client\androidx.health.health-services-client.csproj::TargetFramework=net8.0-android] C:\Repos\AndroidX\generated\androidx.health.health-services-client\obj\Release\net8.0-android\generated\src\AndroidX.Health.Services.Client.Data.DebouncedDataTypeCondition.cs(135,90): error CS0111: Type 'DebouncedDataTypeCondition.Companion' already defines a member called 'CreateDebouncedDataType Condition' with the same parameter types [C:\Repos\AndroidX\generated\androidx.health.health-services-client\androidx.health.health-services-client.csproj::TargetFramework=net8.0-android]

In this case you can change the name of the managed function (name="managedName" DebouncedDataTypeCondition2 or DebouncedDataTypeConditionWithParameterType)

EagleDelux commented 4 months ago

I tried add this to but my build failed to. I added <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="34" tools:overrideLibrary="androidx.health.connect.client,androidx.health.services.client"/> to AndroidManifest.xml and it build succesfuly. (should maybe instruct not build for android versions lower than what is defined in the library but not sure how you do this. I did't have use for androidx.health.services.client but I can try to bump it to and fix the build errors.

@DevronB It turns out that you change minSdkVersion from project.csproj <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">26.0</SupportedOSPlatformVersion> That also fix this error.

DevronB commented 4 months ago

@EagleDelux I already have:

image

as 28 is the min my app supports, and my project is android only, not MAUI.

The above does not reslove the error for me, but using tools:overrideLibrary in maifest does 🤷

DevronB commented 4 months ago

@moljac, how close are we getting to this being published and deployed to main->nuget?

EagleDelux commented 4 months ago

@EagleDelux I already have:

image

as 28 is the min my app supports, and my project is android only, not MAUI.

The above does not reslove the error for me, but using tools:overrideLibrary in maifest does 🤷

That works fine for me. Your error coms from another library: 'com.google.android.gms.tasks' used in: AndroidManifest.xml, AndroidManifest.xml. [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: [C:\Repos\App\App.csproj] C:\Repos\App\obj\Release\net8.0-android\AndroidManifest.xml(9,3): java.exe error AMM0000: uses-sdk:minSdkVersion 28 cannot be smaller than version 30 declared in library C:\Repos\App\obj\Release\net8.0-android\lp\120\jl\AndroidManifest.xml as the library mi ght be using APIs not available in 28

DevronB commented 4 months ago

@moljac, how close are we getting to this being published and deployed to main->nuget?

any updates?