That is by design, of course it doesn't work easily, people keep trying to fit a square peg into a round hole.

From the official NDK documentation.

"The NDK may not be appropriate for most novice Android programmers who need to use only Java code and framework APIs to develop their apps. However, the NDK can be useful for cases in which you need to do one or more of the following:

- Squeeze extra performance out of a device to achieve low latency or run computationally intensive applications, such as games or physics simulations.

- Reuse your own or other developers' C or C++ libraries. "

Anyone that keeps not understanding that point of view naturally run into walls that Android team has no plans to ever change.

Even so, it’s quite limiting and makes it difficult for e.g. non-JVM UI libraries to exist on Android. No other popular platform has this issue.

Mostly because Android was on the forefront that is about time to move from C and C++ for the whole application stack.

Note that you also aren't without issues on Apple platforms if the language doesn't plug into the Objective-C or Swift runtimes in some form.

Likewise on Windows if the language isn't able to talk .NET or COM/WinRT.