android - 我的应用程序发布前报告中的兼容性问题:android.os.strictmode.NonSdkApiUsedViolation
问题描述
我的 Google Play 发布前报告返回了 10 条 Android 兼容性警告,其中包括以下 4 条:
StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()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 androidx.appcompat.widget.ViewUtils.makeOptionalFitsSystemWindows(ViewUtils.java:84)
at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:827)
at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:659)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:552)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
at com.chiaramail.pento.FivetoGo.onCreate(FivetoGo.java:277)
at android.app.Activity.performCreate(Activity.java:7144)
at android.app.Activity.performCreate(Activity.java:7135)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at androidx.test.runner.MonitoringInstrumentation.callActivityOnCreate(MonitoringInstrumentation.java:184)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2931)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3086)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6718)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
加上对 Landroid/graphics/FontFamily、Landroid/graphics/Typeface、computeFitSystemWindows、PopupWindow->setClipToScreenEnabled 和 PopupWindow->setEpicenterBounds 的注释。我没有直接调用这些方法中的任何一个,所以我不明白问题出在哪里。
解决方案
推荐阅读
- python-3.x - 如何在执行任何 api 之前检查条件 - python
- java - “gradle 依赖项”与 Gradle 缓存的差异
- r - 如何在 R 中使用向量填充列表
- android - 如何从 MaterialButton.addOnCheckedChangeListener { "as a lambda" } 获取监听器
- sdk - 如何通过 Xilinx SDK 中的 DMA 从内存向自定义流 IP 发送数据?
- python - 如何使用 BS4 打印类中的文本?
- apache-spark - 获取昨天日期的 NIFI 表达式
- spring-boot - Fazer 上传 Multipart usando Java SpringBoot
- spring-batch - 了解 JobLauncherTestUtils
- python - AWS Lambda 将最后修改的对象从 S3 复制到另一个 S3 存储桶