How to fix Non-SDK interfaces usage on Android 9
Hi guys!
When I upload apk to Google, prelaunch reports give me warning on Android 9 devices:
Non-SDK interfaces usage.
What can cause this?
Im trying to update my game with target api 28. My project only has two plugins:
Play games plugin for unity (sign in and cloud save games) and Unity IAP. Both are latest versions.
I also have usesCleartextTraffic=true inside my Android manifest (i read text from php page). That's all. Nothing special.
I have updayed to 2018.2.8f and latest SDK but nothing changes. Im building with Gradle and Mono.
Please, give me some hints!
Thanks!
Answer by Mccbbi · Sep 22, 2018 at 07:42 PM
I run some test in Firebase Test Lab with Pixel2 API28. It says:
Your app uses 3 non-SDK interfaces, which are incompatible with Android P+. Take a look at the logs to see detailed stack traces. Sample of used non-SDK interfaces:
Landroid/media/AudioSystem;->getPrimaryOutputFrameCount()I
Landroid/media/AudioSystem;->getPrimaryOutputSamplingRate()I
Ljava/lang/invoke/MethodHandles$Lookup;->(Ljava/lang/Class;I)V
Logs has bunch of messages like the following and I have no Idea what it all means;(
09-22 07:02:23.147: D/StrictMode(13069): StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Landroid/media/AudioSystem;->getPrimaryOutputFrameCount()I
09-22 07:02:23.147: D/StrictMode(13069): at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
09-22 07:02:23.147: D/StrictMode(13069): at android.os.-$$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
09-22 07:02:23.147: D/StrictMode(13069): at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
09-22 07:02:23.147: D/StrictMode(13069): at com.unity3d.player.UnityPlayer.c(Unknown Source:0)
09-22 07:02:23.147: D/StrictMode(13069): at com.unity3d.player.UnityPlayer$e$2.queueIdle(Unknown Source:72)
09-22 07:02:23.147: D/StrictMode(13069): at android.os.MessageQueue.next(MessageQueue.java:395)
09-22 07:02:23.147: D/StrictMode(13069): at android.os.Looper.loop(Looper.java:160)
09-22 07:02:23.147: D/StrictMode(13069): at com.unity3d.player.UnityPlayer$e.run(Unknown Source:32)
Answer by Grimicus · Oct 16, 2018 at 05:17 PM
I'm getting this now too. I suspect that this is in Unity's court to update because the things it is complaining about aren't things we can control as far as I know.
Answer by Kurt-Dekker · May 12, 2019 at 01:09 AM
I started getting this building with old Unity5 LTS. I posted about it here:
https://forum.unity.com/threads/google-play-api-warnings-started-today.676654/
Kurt