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

Proguard rules needed for PageIterator #2265

Open
jefftharris opened this issue Jan 5, 2025 · 0 comments
Open

Proguard rules needed for PageIterator #2265

jefftharris opened this issue Jan 5, 2025 · 0 comments
Labels
status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience

Comments

@jefftharris
Copy link

Describe the bug

On Android with a minified build, an exception occurs with PageIterator over DriveItems. The PageIterator class calls getDeclaredMethod("getValue") on the response class. The response getValue method appears to be removed by the minified build.

Exception:

java.lang.IllegalAccessException: NO_COLLECTION_PROPERTY_ERROR
at com.microsoft.graph.core.tasks.PageIterator.extractEntityListFromParsable(PageIterator.java:300)
at com.microsoft.graph.core.tasks.PageIterator$Builder.build(PageIterator.java:203)
at com.microsoft.graph.core.tasks.PageIterator$Builder.build(PageIterator.java:210)

Expected behavior

Proguard rules provided by the library would include the needed classes/methods for PageIterator to work.

How to reproduce

Code:

var resp = 
        client.drives().byDriveId(driveId).items().byDriveItemId("root").children().get();

var pageIter =
        new PageIterator.Builder<DriveItem, DriveItemCollectionResponse>()
        .client(client)
        .collectionPage(resp)
        .collectionPageFactory(DriveItemCollectionResponse::createFromDiscriminatorValue)
        .processPageItemCallback(item -> {
                                        // use DriveItem item...
                                        return true;
                                    })
        .build();
pageIter.iterate();

SDK Version

6.24.0

Latest version known to work for scenario above?

No response

Known Workarounds

Add Proguard rule: -keep class com.microsoft.graph.models.DriveItemCollectionResponse { *; }

Debug output

No response

Configuration

No response

Other information

No response

@jefftharris jefftharris added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

1 participant