如何解决选择菜单选项时出现 NonSDKApi 违规
当我选择查看菜单选项时,我遇到了 NonSdkApiUsedViolation 违规,违规是... "Landroid/widget/AbsListView;->mIsChildViewEnabled:Z"
我重构了我的项目以迁移到 Androidx 并设置 gradle 属性
android.useAndroidX=true`
android.enableJetifier=true
android.enableR8.fullMode=false
我正在努力寻找触发此违规行为的任何内容,该应用程序运行正常,我只是不确定是否要忽略此问题。 总的来说,我不知道如何识别或修复报告的任何 NonSDKApi 违规行为。
如有任何帮助我理解或提供任何建议以查找和消除此特定 SDK 违规行为,我们将不胜感激
依赖项{
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.preference:preference:1.1.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'com.google.android.gms:play-services-maps:17.0.1'
implementation 'com.google.android.libraries.places:places:2.4.0'
implementation fileTree(dir: 'libs',include: ['*.jar'])
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.android.gms:play-services-location:18.0.0'
implementation 'com.android.volley:volley:1.2.0'
implementation 'com.google.firebase:firebase-crashlytics:18.1.0'
implementation 'com.google.firebase:firebase-analytics:19.0.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
24400-24400 D/StrictMode:StrictMode 政策违规:android.os.strictmode.NonSdkApiUsedViolation:Landroid/widget/AbsListView;->mIsChildViewEnabled:Z 在 android.os.StrictMode.lambda$static$1(StrictMode.java:416) 在 android.os.-$$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(未知来源:2) 在 java.lang.Class.getDeclaredField(Native Method) 在 androidx.appcompat.widget.DropDownListView.(DropDownListView.java:124) 在 androidx.appcompat.widget.MenuPopupWindow$MenuDropDownListView.(MenuPopupWindow.java:147) 在 androidx.appcompat.widget.MenuPopupWindow.createDropDownListView(MenuPopupWindow.java:80) 在 androidx.appcompat.widget.ListPopupWindow.buildDropDown(ListPopupWindow.java:1178) 在 androidx.appcompat.widget.ListPopupWindow.show(ListPopupWindow.java:663) 在 androidx.appcompat.view.menu.StandardMenuPopup.tryShow(StandardMenuPopup.java:181) 在 androidx.appcompat.view.menu.StandardMenuPopup.show(StandardMenuPopup.java:208) 在 androidx.appcompat.view.menu.MenuPopupHelper.showPopup(MenuPopupHelper.java:296) 在 androidx.appcompat.view.menu.MenuPopupHelper.tryShow(MenuPopupHelper.java:182) 在 androidx.appcompat.widget.ActionMenuPresenter$OpenOverflowRunnable.run(ActionMenuPresenter.java:792) 在 android.os.Handler.handleCallback(Handler.java:938) 在 android.os.Handler.dispatchMessage(Handler.java:99) 在 android.os.Looper.loop(Looper.java:246) 在 android.app.ActivityThread.main(ActivityThread.java:8512) 在 java.lang.reflect.Method.invoke(Native Method) 在 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602) 在 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1139)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。