square / retrofit

A type-safe HTTP client for Android and the JVM

Home Page:https://square.github.io/retrofit/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

An illegal reflective access operation has occurred

shanjunmei opened this issue · comments

What kind of issue is this?

  • Question. This issue tracker is not the place for questions. If you want to ask how to do
    something, or to understand why something isn't working the way you expect it to, use Stack
    Overflow. https://stackoverflow.com/questions/tagged/retrofit

  • Bug report. If you’ve found a bug, spend the time to write a failing test. Bugs with tests
    get fixed. Here’s an example: https://gist.github.com/swankjesse/6608b4713ad80988cdc9
    WARNING: An illegal reflective access operation has occurred
    WARNING: Illegal reflective access by retrofit2.Platform (file:/home/mls/cc1_robot/robot-agent-v2.0/robot-agent-2.7.6-53-g7ac1a8f-dev.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
    WARNING: Please consider reporting this to the maintainers of retrofit2.Platform
    WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations

  • Feature Request. Start by telling us what problem you’re trying to solve. Often a solution
    already exists! Don’t send pull requests to implement new features without first getting our
    support. Sometimes we leave features out on purpose to keep the project small.

You're either using an old version of Retrofit, in which case I would recommend upgrading to the latest version where this is fixed. Or you are using an old JVM (older than 16), in which case I would recommend using the latest (22) where this reflection is not used since Java 16 finally introduced a support way of invoking default methods on a Proxy.

You're either using an old version of Retrofit, in which case I would recommend upgrading to the latest version where this is fixed. Or you are using an old JVM (older than 16), in which case I would recommend using the latest (22) where this reflection is not used since Java 16 finally introduced a support way of invoking default methods on a Proxy.
got it ,thanks ,btw retrofit version is 2.9.0, JVM is 11