Skip to content

class-parse output is missing types #358

New issue

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

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

Already on GitHub? # to your account

Closed
Redth opened this issue Aug 8, 2018 · 4 comments
Closed

class-parse output is missing types #358

Redth opened this issue Aug 8, 2018 · 4 comments

Comments

@Redth
Copy link
Member

Redth commented Aug 8, 2018

Take the newest version of the recyclerview-v7 support library (Download https://dl.google.com/dl/android/maven2/com/android/support/recyclerview-v7/28.0.0-beta01/recyclerview-v7-28.0.0-beta01.aar extract the .aar, and run the mono class-parse.exe classes.jar > out.xml).

Notice that the output api xml does not include: com.android.support.v7.widget.RecyclerView, as well as RecyclerView.ViewHolder, RecyclerView.Adapter, among other types.

This wasn't a problem with v27.1.1 of this library and I don't see a lot that has changed public API wise in v28.x.

@jonpryor
Copy link
Contributor

jonpryor commented Aug 8, 2018

Hm....

$ mono /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/xbuild/Xamarin/Android/class-parse.exe classes.jar > classes.xml

Results in classes.xml, which contains:

    <class
      abstract="false"
      deprecated="not deprecated"
      jni-extends="Landroid/view/ViewGroup;"
      extends="android.view.ViewGroup"
      extends-generic-aware="android.view.ViewGroup"
      final="false"
      name="RecyclerView"
      jni-signature="Landroid/support/v7/widget/RecyclerView;"
      static="false"
      visibility="public">

Notice the //class/@jni-signature attribute value: Landroid/support/v7/widget/RecyclerView;.

This is not com.android.support.v7.widget, but instead android.support.v7.widget; the com has been dropped.

Additionally, that matches the contents of classes.jar:

$ jar tf classes.jar | grep RecyclerView.class
android/support/v7/widget/RecyclerView.class

@Redth
Copy link
Member Author

Redth commented Aug 8, 2018

My mistake on the com. part, this doesn't exist in the .class file (just the maven repo name).

I guess class-parse output does include this information, however api.xml does not.

Here's a diagnostic log: https://gist.github.com/Redth/7122aa97ce049e75c83f7a1a6b5cee9a

@jonpryor
Copy link
Contributor

jonpryor commented Aug 8, 2018

@Redth: Thank you for the diagnostic log.

The problem -- which isn't raised very well, sorry -- is this:

    Error while processing type '[Class] android.support.v7.widget.RecyclerView': Type 'android.support.v4.view.ScrollingView' was not found.

Without the ScrollingView type, the RecyclerView type can't be bound, because RecyclerView implements ScrollingView:

    <class
      abstract="false"
      deprecated="not deprecated"
      jni-extends="Landroid/view/ViewGroup;"
      extends="android.view.ViewGroup"
      extends-generic-aware="android.view.ViewGroup"
      final="false"
      name="RecyclerView"
      jni-signature="Landroid/support/v7/widget/RecyclerView;"
      static="false"
      visibility="public">
      <implements
        name="android.support.v4.view.ScrollingView"
        name-generic-aware="android.support.v4.view.ScrollingView"
        jni-type="Landroid/support/v4/view/ScrollingView;" />
      <implements
        name="android.support.v4.view.NestedScrollingChild2"
        name-generic-aware="android.support.v4.view.NestedScrollingChild2"
        jni-type="Landroid/support/v4/view/NestedScrollingChild2;" />

Offhand, this seems somewhat absurd to me: if the class isn't final, why do we need to fully resolve all implemented interfaces? Regardless, that's why RecyclerView can't be bound.

@jonpryor
Copy link
Contributor

Closing this issue, as Issue #371 is the "actual" issue to fix.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 14, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants