Google Play API warnings started today

I started getting Google API greylisting warnings today, specifically:

Android compatibility

We’ve detected that your app is using unsupported APIs. Tests may not have found all unsupported APIs. Learn more

Unsupported
 2 warnings identified

The following APIs are greylisted and Google can’t guarantee that they will work on existing versions of Android. Some may be already be restricted for your target SDK

API Landroid/media/AudioSystem;->getPrimaryOutputFrameCount()I
1 occurrence identified

API Landroid/media/AudioSystem;->getPrimaryOutputSamplingRate()I
1 occurrence identified

Is there any user-facing setting in Unity to fix this problem?

Is there any plan to back-port a fix for this to the Unity5 long-term support?

I am getting the same thing using the current 2019 release.

1 Like

I also have a warning that recently started showing up, although a different one. I’m using Unity 2018.3.11.

API Ljava/lang/invoke/MethodHandles$Lookup;-><init>(Ljava/lang/Class;I)V

Stacktrace:

StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Ljava/lang/invoke/MethodHandles$Lookup;-><init>(Ljava/lang/Class;I)V
    at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
    at android.os.-$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
    at java.lang.Class.getDeclaredConstructorInternal(Native Method)
    at java.lang.Class.getConstructor0(Class.java:2325)
    at java.lang.Class.getDeclaredConstructor(Class.java:2166)
    at bitter.jnibridge.JNIBridge$a.<init>(Unknown Source:25)
    at bitter.jnibridge.JNIBridge.newInterfaceProxy(Unknown Source:8)
    at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    at com.unity3d.player.UnityPlayer.c(Unknown Source:0)
    at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source:72)
    at android.os.MessageQueue.next(MessageQueue.java:395)
    at android.os.Looper.loop(Looper.java:160)
    at com.unity3d.player.UnityPlayer$e.run(Unknown Source:32)

Am I reading this right it is a runtime error?

If so, what Android OS are you running on?

I haven’t seen it show up as a runtime error myself, it popped up in the Android Compatibility section of the pre-launch report on the Google Play console. Under a warning stating

The following APIs are grey-listed and Google can’t guarantee that they will work on existing versions of Android. Some may already be restricted for your target SDK

1 Like

More info about greylist apis here: Restrictions on non-SDK interfaces  |  Platform  |  Android Developers

We are in contact with Google regarding these warnings. Will keep you posted.

7 Likes

Also getting these. FWIW, we also got this one:

StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Ljava/lang/invoke/MethodHandles$Lookup;-><init>(Ljava/lang/Class;I)V
    at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
    at android.os.-$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
    at java.lang.Class.getDeclaredConstructorInternal(Native Method)
    at java.lang.Class.getConstructor0(Class.java:2325)
    at java.lang.Class.getDeclaredConstructor(Class.java:2166)
    at bitter.jnibridge.JNIBridge$a.<init>(Unknown Source:25)
    at bitter.jnibridge.JNIBridge.newInterfaceProxy(Unknown Source:8)
    at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    at com.unity3d.player.UnityPlayer.c(Unknown Source:0)
    at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source:72)
    at android.os.MessageQueue.next(MessageQueue.java:395)
    at android.os.Looper.loop(Looper.java:160)
    at com.unity3d.player.UnityPlayer$e.run(Unknown Source:32)

I have the same problem

Same problem, I got three of these, hope we will get the response soon…:

API Ljava/lang/invoke/MethodHandles$Lookup;-><init>(Ljava/lang/Class;I)V
21 occurrences identified. Only unique stack traces are shown.
Stack trace 1
StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Ljava/lang/invoke/MethodHandles$Lookup;-><init>(Ljava/lang/Class;I)V
    at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
    at android.os.-$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
    at java.lang.Class.getDeclaredConstructorInternal(Native Method)
    at java.lang.Class.getConstructor0(Class.java:2325)
    at java.lang.Class.getDeclaredConstructor(Class.java:2166)
    at bitter.jnibridge.JNIBridge$a.<init>(Unknown Source:25)
    at bitter.jnibridge.JNIBridge.newInterfaceProxy(Unknown Source:8)
    at com.unity3d.player.UnityPlayer.nativeDone(Native Method)
    at com.unity3d.player.UnityPlayer.g(Unknown Source:3)
    at com.unity3d.player.UnityPlayer.k(Unknown Source:0)
    at com.unity3d.player.UnityPlayer$21.run(Unknown Source:2)
    at android.os.Handler.handleCallback(Handler.java:873)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:193)
    at com.unity3d.player.UnityPlayer$e.run(Unknown Source:32)
Stack trace 2
StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Ljava/lang/invoke/MethodHandles$Lookup;-><init>(Ljava/lang/Class;I)V
    at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
    at android.os.-$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
    at java.lang.Class.getDeclaredConstructorInternal(Native Method)
    at java.lang.Class.getConstructor0(Class.java:2325)
    at java.lang.Class.getDeclaredConstructor(Class.java:2166)
    at bitter.jnibridge.JNIBridge$a.<init>(Unknown Source:25)
    at bitter.jnibridge.JNIBridge.newInterfaceProxy(Unknown Source:8)
    at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    at com.unity3d.player.UnityPlayer.c(Unknown Source:0)
    at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source:72)
    at android.os.MessageQueue.next(MessageQueue.java:395)
    at android.os.Looper.loop(Looper.java:160)
    at com.unity3d.player.UnityPlayer$e.run(Unknown Source:32)
API Landroid/media/AudioSystem;->getPrimaryOutputFrameCount()I
2 occurrences identified. Only unique stack traces are shown.
Stack trace 1
StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Landroid/media/AudioSystem;->getPrimaryOutputFrameCount()I
    at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
    at android.os.-$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
    at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    at com.unity3d.player.UnityPlayer.c(Unknown Source:0)
    at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source:72)
    at android.os.MessageQueue.next(MessageQueue.java:395)
    at android.os.Looper.loop(Looper.java:160)
    at com.unity3d.player.UnityPlayer$e.run(Unknown Source:32)
[ 05-21 07:37:04.514 14111:14164 D/         ]
PlayerBase::PlayerBase()
[ 05-21 07:37:04.515 14111:14164 D/         ]
TrackPlayerBase::TrackPlayerBase()
Stack trace 2
StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Landroid/media/AudioSystem;->getPrimaryOutputFrameCount()I
    at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
    at android.os.-$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
    at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    at com.unity3d.player.UnityPlayer.c(Unknown Source:0)
    at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source:72)
    at android.os.MessageQueue.next(MessageQueue.java:395)
    at android.os.Looper.loop(Looper.java:160)
    at com.unity3d.player.UnityPlayer$e.run(Unknown Source:32)
[ 05-21 08:06:10.738 11443:11484 D/         ]
PlayerBase::PlayerBase()
[ 05-21 08:06:10.739 11443:11484 D/         ]
TrackPlayerBase::TrackPlayerBase()
API Landroid/media/AudioSystem;->getPrimaryOutputSamplingRate()I
2 occurrences identified. Only unique stack traces are shown.
Stack trace 1
StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Landroid/media/AudioSystem;->getPrimaryOutputSamplingRate()I
    at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
    at android.os.-$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
    at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    at com.unity3d.player.UnityPlayer.c(Unknown Source:0)
    at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source:72)
    at android.os.MessageQueue.next(MessageQueue.java:395)
    at android.os.Looper.loop(Looper.java:160)
    at com.unity3d.player.UnityPlayer$e.run(Unknown Source:32)

Same thing here, 11 total “greylist” warnings. From AudioSystem, SmartSelectionEventTracker and bindServiceAsUser.

Using Unity 2017.4.20f1 - 2017.4.27f1 (LTS versions).

Started after April 11, but before May 9th for me.

Thanks @Yury-Habets

1 Like

We’re having same 11 greylist warnings on Unity 2018.221f1.

Looking forward to an update @Yury-Habets .
Thanks.
Anthony

I have the same problem when I uploaded APK file on Internaltest track of Google Console.
I am waiting help from Yury-Habets.

Thanks.

Same thing for me on Unity 2019.

StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Ljava/lang/invoke/MethodHandles$Lookup;-><init>(Ljava/lang/Class;I)V
   at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
   at android.os.-$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
   at java.lang.Class.getDeclaredConstructorInternal(Native Method)
   at java.lang.Class.getConstructor0(Class.java:2325)
   at java.lang.Class.getDeclaredConstructor(Class.java:2166)
   at bitter.jnibridge.JNIBridge$a.<init>(Unknown Source:25)
   at bitter.jnibridge.JNIBridge.newInterfaceProxy(Unknown Source:8)
   at com.unity3d.player.UnityPlayer.nativeFocusChanged(Native Method)
   at com.unity3d.player.UnityPlayer.a(Unknown Source:0)
   at com.unity3d.player.UnityPlayer$e$1.a(Unknown Source:19)
   at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:149)
   at android.os.Handler.dispatchMessage(Handler.java:102)
   at android.os.Looper.loop(Looper.java:193)
   at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Landroid/media/AudioSystem;->getPrimaryOutputFrameCount()I
   at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
   at android.os.-$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
   at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
   at com.unity3d.player.UnityPlayer.c(Unknown Source:0)
   at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:88)
   at android.os.Handler.dispatchMessage(Handler.java:102)
   at android.os.Looper.loop(Looper.java:193)
   at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
[ 06-11 08:43:01.947 15218:15246 D/         ]
PlayerBase::PlayerBase()
[ 06-11 08:43:01.948 15218:15246 D/         ]
TrackPlayerBase::TrackPlayerBase()
StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Landroid/media/AudioSystem;->getPrimaryOutputSamplingRate()I
   at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
   at android.os.-$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
   at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
   at com.unity3d.player.UnityPlayer.c(Unknown Source:0)
   at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:88)
   at android.os.Handler.dispatchMessage(Handler.java:102)
   at android.os.Looper.loop(Looper.java:193)

I am also getting these warnings:

StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Ljava/lang/invoke/MethodHandles$Lookup;-><init>(Ljava/lang/Class;I)V
    at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
    at android.os.-$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
    at java.lang.Class.getDeclaredConstructorInternal(Native Method)
    at java.lang.Class.getConstructor0(Class.java:2325)
    at java.lang.Class.getDeclaredConstructor(Class.java:2166)
    at bitter.jnibridge.JNIBridge$a.<init>(Unknown Source:25)
    at bitter.jnibridge.JNIBridge.newInterfaceProxy(Unknown Source:8)
    at com.unity3d.player.UnityPlayer.nativeDone(Native Method)
    at com.unity3d.player.UnityPlayer.g(Unknown Source:3)
    at com.unity3d.player.UnityPlayer.k(Unknown Source:0)
    at com.unity3d.player.UnityPlayer$22.run(Unknown Source:2)
    at android.os.Handler.handleCallback(Handler.java:873)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:193)
    at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Ljava/lang/invoke/MethodHandles$Lookup;-><init>(Ljava/lang/Class;I)V
    at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
    at android.os.-$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
    at java.lang.Class.getDeclaredConstructorInternal(Native Method)
    at java.lang.Class.getConstructor0(Class.java:2325)
    at java.lang.Class.getDeclaredConstructor(Class.java:2166)
    at bitter.jnibridge.JNIBridge$a.<init>(Unknown Source:25)
    at bitter.jnibridge.JNIBridge.newInterfaceProxy(Unknown Source:8)
    at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    at com.unity3d.player.UnityPlayer.c(Unknown Source:0)
    at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:88)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:193)
    at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Landroid/media/AudioSystem;->getPrimaryOutputFrameCount()I
    at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
    at android.os.-$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
    at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    at com.unity3d.player.UnityPlayer.c(Unknown Source:0)
    at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:88)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:193)
    at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
[ 06-12 08:13:11.912 13203:13258 D/         ]
PlayerBase::PlayerBase()
[ 06-12 08:13:11.912 13203:13258 D/         ]
TrackPlayerBase::TrackPlayerBase()
StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Landroid/media/AudioSystem;->getPrimaryOutputSamplingRate()I
    at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
    at android.os.-$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
    at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
    at com.unity3d.player.UnityPlayer.c(Unknown Source:0)
    at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:88)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:193)
    at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)

What do I need to do about it?

I upgraded from 2018 to 2019 release and I am getting 13 of these now.

1 Like

any update to this?

The official message is coming soon.

7 Likes

Hope to solve it soon.

Hey all,

Thanks for looking into this problem.

I have 2 Unity projects and I was just about to release them (one being an updated app and the 2nd being a new release) but I happened to notice the ‘pre-launch report’ menu item in Google Play. For my 2 apps I have the errors below.

My 2 apps are education based, i.e. text boxes, audio playing from file asset, buttons, toggles, screen navigation,impage backgrounds, android device back button functionality, link to website online, etc. No animation, they are 2D set up, no saving data apart from player prefs of volume setting,

errors:

App 1 updated app
API Ljava/lang/invoke/MethodHandles$Lookup;->(Ljava/lang/Class;I)V
20 occurrences identified. Only unique stack traces are shown.

API Landroid/media/AudioSystem;->getPrimaryOutputFrameCount()I
2 occurrences identified. Only unique stack traces are shown.

API Landroid/media/AudioSystem;->getPrimaryOutputSamplingRate()I
2 occurrences identified. Only unique stack traces are shown.


App2 was to be a newly released app

API Ljava/lang/invoke/MethodHandles$Lookup;->(Ljava/lang/Class;I)V
22 occurrences identified. Only unique stack traces are shown.

API Landroid/media/AudioSystem;->getPrimaryOutputFrameCount()I
2 occurrences identified. Only unique stack traces are shown.

API Landroid/media/AudioSystem;->getPrimaryOutputSamplingRate()I
2 occurrences identified. Only unique stack traces are shown.

I am learning as I go with Unity dev, I come from a java background but am making apps using unity in c# now. I have 2 questions, I wonder if anyone could give their opinions please? I will of course wait for the reply/ongoing search for info on the overall issue of this thread/topic.

  1. I wonder with using Unity components, and all that goes into the how unity builds the .apk, I wonder if there is always going to be these errors in some form. We can change our code to utilise public SDK’s but is Unity doing the same? What is the vibe out there in the Unity community?

  2. Given the restrictions on non-SDK interfaces is due to “Starting in Android 9 (API level 28), the platform restricts which non-SDK interfaces your app can use…” - we have all read on developer. android. com. is it probable that if we have the ‘Unity -->Build Settings -->Target API’ not higher than 27 , will this remove the problems? Yes we will loose the current 10.4% market share of devices that use Android 9, but its a trade off for the amount of time to try and combat these issues to get zero errors (if indeed it is something we can fix, given your thoughts on 1)above)

thanks