Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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)

like image 894
jacace Avatar asked May 29 '20 22:05

jacace


1 Answers

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

like image 142
Corentin Jacquet Avatar answered Sep 21 '22 23:09

Corentin Jacquet