简体   繁体   English

在 android 工作室中将 targetSDK 更改为 29 后关闭应用程序

[英]shut down app after changing targetSDK to 29 in android studio

compileSdkVersion 29
defaultConfig {
    ...
    targetSdkVersion 29
    ...
}

According to the Play Console, the new app will change to SDK 29 from August and cannot be uploaded unless updated from November.根据 Play 管理中心的说法,新应用将从 8 月开始更改为 SDK 29,除非从 11 月更新,否则无法上传。 The app ended abnormally after changing the target SDK to 29. The log is:将目标SDK改为29后app异常结束,日志为:

W/abc.def: Accessing hidden field Landroid/view/LayoutInflater;->mConstructorArgs: [Ljava/lang/Object; W/abc.def: 访问隐藏字段 Landroid/view/LayoutInflater;->mConstructorArgs: [Ljava/lang/Object; (greylist-max-p, reflection, denied) (灰名单-max-p,反射,拒绝)

D/AndroidRuntime: Shutting down VM D/AndroidRuntime:关闭虚拟机

E/AndroidRuntime: FATAL EXCEPTION: main Process: net.abc.def, PID: 28318 java.lang.RuntimeException: Unable to start activity ComponentInfo{net.abc.def/net.abc.def.ui.SplashActivity}: android.view.InflateException: Binary XML file line #17 in net.abc.def:layout/abc_screen_simple: Binary XML file line #17 in net.abc.def:layout/abc_screen_simple: Error inflating class android.support.v7.widget.FitWindowsLinearLayout E/AndroidRuntime:致命异常:主进程:net.abc.def,PID:28318 java.lang.RuntimeException:无法启动活动 ComponentInfo{net.abc.def/net.abc.def.ui.SplashActivity}:ZC31B32364CE19CA58FCD150A417. view.InflateException: Binary XML file line #17 in net.abc.def:layout/abc_screen_simple: Binary XML file line #17 in net.abc.def:layout/abc_screen_simple: Error inflating class android.support.v7.widget.FitWindowsLinearLayout

I guess this is because I am using a non-SDK interface.我想这是因为我使用的是非 SDK 接口。 Because Google explains as follows因为谷歌解释如下

Landroid/view/LayoutInflater;->mConstructorArgs:[Ljava/lang/Object;

#No public alternative. #没有公共选择。 Developers should never access this field directly.开发人员不应直接访问此字段。

Is the abnormal termination due to a non-sdk interface?是非sdk接口导致的异常终止吗? So how do you solve it?那你怎么解决呢? Many LayoutInflaters are used in the my code.我的代码中使用了许多 LayoutInflaters。

If you were not touching mConstructorArgs in your source-code then try searching if any of your libraries was accessing that field.如果您没有在源代码中接触 mConstructorArgs,请尝试搜索您的任何库是否正在访问该字段。

In my case the culprit was the old version of Calligraphy library.就我而言,罪魁祸首是旧版本的书法库。 在此处输入图像描述

Crash on calligraphy library by chris Jenx for Android Q chris Jenx 为 Android Q 在书法库上崩溃

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM