Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AndroidX.Leanback.Preference missing ...Compat #354

Closed
svrooij opened this issue Aug 3, 2021 · 17 comments · May be fixed by #714
Closed

AndroidX.Leanback.Preference missing ...Compat #354

svrooij opened this issue Aug 3, 2021 · 17 comments · May be fixed by #714
Assignees
Labels
new-package-request Request for a new package to be bound

Comments

@svrooij
Copy link

svrooij commented Aug 3, 2021

Version Information

  • Visual Studio version (eg. 16.8 or 8.8): 16.10.4
  • Xamarin.Android version (eg. 11.1): 11.3.0.4
  • Using AndroidX or Support Libraries: AndroidX
  • If Support Libraries, version (eg 28.0.0):

Describe your Issue:

I'm trying to use AndroidX.Leanback.Preference but all the ...Compat classes seems to be missing.

For instance the LeanbackSettingsFragmentCompat which I seem to be using. All the classes without Compat have [Obsolete] everywhere.

Steps to Reproduce (with link to sample solution if possible):

  1. Create Xamarin.Android app
  2. Add Xamarin.AndroidX.Preference and Xamarin.AndroidX.Leanback.Preference
  3. Try to create a class that extends LeanbackSettingsFragmentCompat

Include any relevant Exception Stack traces, build logs, adb logs:

@moljac moljac self-assigned this Sep 10, 2021
@leandroconsiglio
Copy link

Any news about this?

@svrooij
Copy link
Author

svrooij commented Apr 5, 2022

I haven't heard anything about this. And must admit I haven't tried anything anymore.

I was for an experimental application, these struggles didn't help.

@leandroconsiglio
Copy link

I have the same problem with my app, there are obsolete warnings everywhere because the Compat classes are missing. I think the maven package reference is old, they have to update it.

@svrooij
Copy link
Author

svrooij commented Apr 6, 2022

@leandroconsiglio I have absolutly no idea how this package is created, but I guess it's generated somehow. Wouldn't we be able to just re-generate it with a new version?

@xamarin can you give us some insights?

@moljac
Copy link
Contributor

moljac commented Apr 6, 2022

@svrooij Thanks for the feedback!

And I am sorry for delays, but I maintain AndroidX and GooglePlayServices/Firebase/MLKit bindings + tons of dependencies.

I have absolutly no idea how this package is created, but I guess it's generated somehow. Wouldn't we be able to just re-generate it with a new version?

You need need to clone and do cake build. It is not trivial, but it is not too hacky. Yes docs about build are not up to date I know.

When submitting issues versions would help a lot. Each of the nuget has its own version:

  • Xamarin.AndroidX.Preference latest is 1.2.0.1
  • Xamarin.AndroidX.Leanback.Preference latest is 1.0.0.13

It would be good to know which of those do you use.

You can paste ProjectReference from *.csproj for those here. That helps a lot.

@moljac
Copy link
Contributor

moljac commented Apr 6, 2022

Notes:

androidx.preference.preference

find ./generated/androidx.preference.preference/ -type f -name "*Compat.cs"

found in both folders

./generated/androidx.preference.preference//obj/Release/net6.0-android/generated/src/
./generated/androidx.preference.preference//obj/Release/monoandroid12.0/generated/src/
AndroidX.Preference.MultiSelectListPreferenceDialogFragmentCompat.cs
AndroidX.Preference.ListPreferenceDialogFragmentCompat.cs
AndroidX.Preference.PreferenceHeaderFragmentCompat.cs
AndroidX.Preference.SwitchPreferenceCompat.cs
AndroidX.Preference.PreferenceDialogFragmentCompat.cs
AndroidX.Preference.PreferenceFragmentCompat.cs
AndroidX.Preference.EditTextPreferenceDialogFragmentCompat.cs

androidx.leanback.leanback-preference

find ./generated/androidx.leanback.leanback-preference/ -type f -name "*Compat.cs"

results:

No *Compat types in api.xml.class-parse.

TODO: decompile

@svrooij
Copy link
Author

svrooij commented Apr 6, 2022

These are the regular preferences screens. Not those specially for Leanback (ANDROID TV).

@moljac
Copy link
Contributor

moljac commented Apr 6, 2022

These are the regular preferences screens. Not those specially for Leanback (ANDROID TV).

yes. I know. Leanback stuff was not found. Why? No idea. (Yet)

@svrooij
Copy link
Author

svrooij commented Apr 6, 2022

So these packages seem to be not updated to the latest version, if I'm understanding correctly?
https://github.com/svrooij/AndroidX/blob/c6ee82cc0aafe7005fc36e1fde536f3d60633908/config.json#L629-L644

For my understanding the cake script checks some xml file where all the android maven packages are stored and then checks there respective version if it's the same with the version of the generated files? If not the same it downloads the new version and generates the bindings for it?

@svrooij
Copy link
Author

svrooij commented Apr 6, 2022

It seems leanback.preference is missing in this file

// Master list of all the packages in the repo:
// https://dl.google.com/dl/android/maven2/master-index.xml

image

but it's present in the other file

image

@moljac
Copy link
Contributor

moljac commented Apr 6, 2022

@svrooij

Advice: images are not searchable, selectable (for copy paste) and slows investigation down.

Try like this:

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

you have several groups:

  • androidx.leanback
    this is needed
  • com.android.support
    old (AndroidSupport) legacy, history

The problem is that for some reason Compat classes were removed from androidx.leanback:leanback-preference

@leandroconsiglio
Copy link

leandroconsiglio commented Apr 6, 2022

@moljac
I'm using the lastest version of Xamarin.AndroidX.Leanback.Preference (1.0.0.13)

The compat classes were added in leanback-preference-1.1.0 and Xamarin is using 1.0.0, that's why they are missing.
Is it possible that the package can be upgraded to 1.1.0? Although there is no stable version yet, maybe a beta version?

@svrooij
Copy link
Author

svrooij commented Apr 6, 2022

@leandroconsiglio thanks for the pointer! It seems the version containing these extra classess it not released as a none beta version. https://maven.google.com/web/index.html#androidx.leanback:leanback-preference

Would it be possible to some how force it to create a beta nuget containing the 1.1.0-rc01 version? Or maybe even the 1.2.0-alpha02.

Ive tried building it locally, but since the generation isn't documented I cannot get it to work. Struggling with error after error.

========================================
libs-native
========================================
Warning: unrecognized type name: platform. Did you mean archives?
Warning: Unable to create an instance of com.android.repository.impl.generated.v1.TypeDetails
java.lang.InstantiationException
        at java.base/jdk.internal.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:48)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
        at com.sun.xml.bind.v2.ClassFactory.create0(ClassFactory.java:132)

@moljac
Copy link
Contributor

moljac commented Mar 27, 2023

closing this issue

androidx.leanback:leanback-preference is still preview.

https://maven.google.com/web/index.html?q=androidx.leanback#androidx.leanback:leanback-preference

Please open issue when the package becomes stable. Thanks

@moljac moljac closed this as completed Mar 27, 2023
@svrooij
Copy link
Author

svrooij commented Mar 27, 2023

This package does not seem te be coming out of preview....
Can't you make an exception? Or at least show how we can use the tools to generate such a package ourself, in case we want to use a beta feature anyway.

@leandroconsiglio
Copy link

Yes is still in preview, but the all classes without Compat have [Obsolete] warning everywhere.

@svrooij
Copy link
Author

svrooij commented Apr 4, 2023

The 18 month old package is still in alpha02 status, hence my request to remove the alpha02 part. Then we will hopefully finally get a release of this package in nuget. https://issuetracker.google.com/issues/276765055

I tried updating the config.json myself with the following, but then building just fails.

      {
        "groupId": "androidx.leanback",
        "artifactId": "leanback-preference",
        "version": "1.2.0-alpha02",
        "nugetVersion": "1.2.0.0-alpha2",
        "nugetId": "Xamarin.AndroidX.Leanback.Preference",
        "dependencyOnly": false
      },
PS C:\Users\stephan\source\repos\AndroidX> dotnet cake --target=binderate
The 'tool' directive is attempting to install the 'Cake.CoreCLR' package 
without specifying a package version number.  
More information on this can be found at https://cakebuild.net/docs/writing-builds/reproducible-builds/ 
It's not recommended, but you can explicitly override this warning 
by configuring the Skip Package Version Check setting to true 
(i.e. command line parameter "--settings_skippackageversioncheck=true", 
environment variable "CAKE_SETTINGS_SKIPPACKAGEVERSIONCHECK=true", 
read more about configuration at https://cakebuild.net/docs/running-builds/configuration/)
The assembly 'Cake.FileHelpers, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null' 
is referencing an older version of Cake.Core (2.0.0). 
The 'tool' directive is attempting to install the 'Cake.CoreCLR' package 
without specifying a package version number.  
More information on this can be found at https://cakebuild.net/docs/writing-builds/reproducible-builds/ 
It's not recommended, but you can explicitly override this warning 
by configuring the Skip Package Version Check setting to true 
(i.e. command line parameter "--settings_skippackageversioncheck=true", 
environment variable "CAKE_SETTINGS_SKIPPACKAGEVERSIONCHECK=true", 
read more about configuration at https://cakebuild.net/docs/running-builds/configuration/)
The assembly 'Cake.MonoApiTools, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null' 
is referencing an older version of Cake.Core (0.33.0). 
For best compatibility it should target Cake.Core version 2.0.0.
C:/Users/stephan/source/repos/AndroidX/build.cake(559,20): warning CS0219: The variable 'xml_namespace_name' is assigned but its value is never used
Error: Object reference not set to an instance of an object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-package-request Request for a new package to be bound
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants