Any clue on how to fix StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation?

4,275

I known the question is quite old, but answering anyway There is a closed issue on the flutter github that seems to correspond to your stack trace : https://github.com/flutter/flutter/issues/36915#issuecomment-525668810 The pined comment explain what happen : Call to SDK API using ReflectionAccessors Class which is discouraged by google as mentionned in https://developer.android.com/guide/app-compatibility/restrictions-non-sdk-interfaces As explained in the github thread, it is safe to ignore those warning because the reflexion calls are protected and fail silently. Hopes this helps

Share:
4,275
jacace
Author by

jacace

Updated on December 21, 2022

Comments

  • jacace
    jacace over 1 year

    I ran some sample automated testing in a sample app and got the warining below. But teh text does not really say anything.

    Has anyone come accress similar warnings? I seems internal working of flutter.

    StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Landroid/util/LongArray;->get(I)J

    Landroid/view/accessibility/AccessibilityNodeInfo;->getSourceNodeId()J at android.os.StrictMode.lambda$static$1(StrictMode.java:407)

    Landroid/view/accessibility/AccessibilityNodeInfo;->getSourceNodeId()J at android.os.StrictMode.lambda$static$1(StrictMode.java:428)

    : Landroid/view/accessibility/AccessibilityNodeInfo;->mChildNodeIds:Landroid/util/LongArray; at android.os.StrictMode.lambda$static$1(StrictMode.java:407)

    Landroid/view/accessibility/AccessibilityNodeInfo;->mChildNodeIds:Landroid/util/LongArray; at android.os.StrictMode.lambda$static$1(StrictMode.java:428)

    Landroid/view/accessibility/AccessibilityRecord;->getSourceNodeId()J at android.os.StrictMode.lambda$static$1(StrictMode.java:407)

    Landroid/view/accessibility/AccessibilityRecord;->getSourceNodeId()J at android.os.StrictMode.lambda$static$1(StrictMode.java:428)