Skip to content

iOS reflection

The iOS application is compiled with GraalVM Native Image. Reflective access and resources that cannot be discovered automatically may need reachability metadata. Dependencies can provide it under META-INF/native-image on their runtime classpath; add metadata for application-specific classes and members where needed.

For example, if code looks up com.example.game.SaveRecord dynamically and invokes its no-argument constructor, a legacy reflection configuration can be placed at app/src/main/resources/META-INF/native-image/com.example/game/reflect-config.json:

[
  {
    "name": "com.example.game.SaveRecord",
    "methods": [ { "name": "<init>", "parameterTypes": [] } ]
  }
]

Replace the example with the members your application actually accesses, then build and test the affected functionality in the native application. The GraalVM reachability metadata documentation explains the available metadata formats.