Skip to content
Jonathan Pobst edited this page Apr 1, 2021 · 1 revision

There are many tools that can come in handy when investigating Android bindings issues.

Diagnostic MSBuild Output

By far the most useful tool is a Diagnostic MSBuild log, which can be enabled with these instructions.

There are many messages describing what issues the binding process is hitting that are not severe enough to warrant being a compiler warning, and thus do not show up by default. These messages are output to the MSBuild log when the severity is set to Diagnostic. Examples of various kinds of messages this will enable are described in the Understanding the Binding Pipeline guide.

Note that many of the steps are cached after they have been run once so that future builds are faster. In order to see messages from these steps you will need to Rebuild the project instead of performing a normal incremental build.

Java Decompiler

The bindings process operates on the compiled Java in a .jar or .aar. This may not necessarily match the documentation or source code that you are viewing for the API. Thus it is often helpful to see what is in the exact Java package you are binding.

  • You can view a .jar by opening/dragging it into the decompiler.
  • You can view an .aar by opening/dragging it into the decompiler and expanding the classes.jar node.

Now it's time for an initial look. Do you see anything out of the ordinary or closely related to the error message at hand?

Here are a couple of things that come to mind:

  • Are there any classes that have characteristics of obfuscation? (only lowercase letters/numbers/$) EX: a.class / a$.class
  • Are there any import statements of libraries not referenced?
  • What respective versions of dependencies does the Binding SDK use?
  • What Android API level does the .jar/.aar support?
  • What version of Java/JDK was this library compiled with?

.NET Decompiler

Occasionally it is useful to examine a .NET assembly, which can be done with a .NET decompiler.

Android API Documentation

It can sometimes be helpful to check the official Android API reference.

This is particularly helpful to see what a type/member was added to the Android platform. For example, the android.hardware.biometrics package was added to Android API Level 29 (Android 9.0), so its types/members will not be available if you are targeting an earlier Android API level.