Android Question Non SDK API Violation

Marcos Alves

Well-Known Member
Licensed User
Longtime User
Hello community,

publishing one of my apps in Play Store I received the warning:

StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Landroid/os/Message;->recycleUnchecked()V

This is something related to the use of "non sdk api". But I didn't use any external api in my app. Play Store recommends also to "fix the warnings" (9 warnings with almost the same "no sdk api" violation).
Does anybody know what is this and how to fix it?

Follows a complete log provided by Store:

Log:
StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Lcom/android/org/conscrypt/OpenSSLSocketImpl;->setAlpnProtocols([B)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.getDeclaredMethodInternal(Native Method)
    at java.lang.Class.getPublicMethodRecursive(Class.java:2075)
    at java.lang.Class.getMethod(Class.java:2063)
    at java.lang.Class.getMethod(Class.java:1690)
    at okhttp3.internal.platform.OptionalMethod.getPublicMethod(OptionalMethod.java:164)
    at okhttp3.internal.platform.OptionalMethod.getMethod(OptionalMethod.java:149)
    at okhttp3.internal.platform.OptionalMethod.isSupported(OptionalMethod.java:55)
    at okhttp3.internal.platform.AndroidPlatform.configureTlsExtensions(AndroidPlatform.java:107)
    at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:237)
    at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:200)
    at okhttp3.internal.connection.RealConnection.buildConnection(RealConnection.java:174)
    at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:114)
    at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:196)
    at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:132)
    at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:101)
    at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
    at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
    at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
    at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
    at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:179)
    at okhttp3.RealCall.execute(RealCall.java:63)
    at anywheresoftware.b4h.okhttp.OkHttpClientWrapper.executeWithTimeout(OkHttpClientWrapper.java:156)
    at anywheresoftware.b4h.okhttp.OkHttpClientWrapper.access$0(OkHttpClientWrapper.java:153)
    at anywheresoftware.b4h.okhttp.OkHttpClientWrapper$ExecuteHelper.run(OkHttpClientWrapper.java:201)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:764)
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
trictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Landroid/os/Message;->recycleUnchecked()V
Ignore it. It is only reached if you call the deprecated DoEvents or Msgbox keywords.

I guess that you should also ignore the conscrypt warning.
 
Upvote 0

Marcos Alves

Well-Known Member
Licensed User
Longtime User
Ignore it. It is only reached if you call the deprecated DoEvents or Msgbox keywords.

I guess that you should also ignore the conscrypt warning.
Thanks @Erel . Google sometimes shows obscure diagnostics in Play Console. Now they launched the new version trying to make it more clear, but for me they got exactly the opposite effect.

Regards!
 
Upvote 0
Top