Graphics Analyzer fails to trace applications running on Android 10

Graphics Analyzer fails when intercepting API calls from applications that contain native C++ code, on devices running Android 10(Q). The interceptor starts normally, but shuts down after the application starts, capturing only one API call. There are no error messages.

Condition

Affected releases: Mobile Studio 2019.0, Mobile Studio 2019.1, Mobile Studio 2019.2.

Cause

This problem occurs because there are changes to the bionic libraries and dynamic linker paths in Android 10.

Workaround

To resolve this issue, you must move the System.loadLibrary() call from the start of the main activity to inside the Native C++ activity constructor. Call the load method after the super.onCreate() call in the onCreate method:

public class YourNativeActivity extends NativeActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
// Call super-class onCreate first super.onCreate(savedInstanceState); // Load interceptor second try { System.loadLibrary("AGA"); } catch (UnsatisfiedLinkError e) { e.printStackTrace(); } ... } }

Related information