- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在按照文章在 Android 12 上实现 Splash Screen API
https://developer.android.com/about/versions/12/splash-screen-migration
我使 Splash Screen API 正常工作,但在 Android 8 和 9 上出现崩溃并重新启动 android 系统。
这是代码和日志:
list .xml
<application
android:name=".App"
android:allowBackup="false"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:theme="@style/AppTheme">
<activity
android:name=".ui.SplashActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.Splash"
android:clearTaskOnLaunch="true"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ui.MainActivity"/>
</application>
样式.xml
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryVariant">@color/colorPrimaryVariant</item>
<item name="colorOnPrimary">@color/white</item>
<item name="colorSecondary">@color/colorSecondary</item>
<item name="colorOnSecondary">@color/white</item>
<item name="colorSurface">@color/white</item>
<item name="colorError">@color/colorError</item>
<item name="android:statusBarColor">@color/colorBackground</item>
<item name="android:navigationBarColor">@color/colorBackground</item>
<item name="android:windowLightStatusBar" tools:ignore="NewApi">true</item>
<item name="android:windowLightNavigationBar" tools:ignore="NewApi">true</item>
<item name="android:windowBackground">@color/colorBackground</item>
</style>
<style name="AppTheme.Splash" parent="Theme.SplashScreen">
<item name="android:windowSplashScreenBackground" tools:ignore="NewApi">@color/colorSecondary</item>
<item name="postSplashScreenTheme">@style/AppTheme.SplashScreen</item>
</style>
<style name="AppTheme.SplashScreen">
<item name="android:statusBarColor">@color/colorSecondary</item>
<item name="android:navigationBarColor">@color/colorSecondary</item>
<item name="android:windowBackground">@drawable/splash</item>
<item name="android:windowLightNavigationBar" tools:ignore="NewApi">false</item>
</style>
样式-v31.xml
<style name="AppTheme.Splash" parent="Theme.SplashScreen">
<item name="android:windowSplashScreenBackground">@color/colorSecondary</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/ic_logo_white</item>
<item name="postSplashScreenTheme">@style/AppTheme.SplashScreen</item>
</style>
日志
021-08-10 11:10:41.725 3296-3368/? E/AndroidRuntime: !@*** FATAL EXCEPTION IN SYSTEM PROCESS: android.anim
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.graphics.drawable.Drawable.isProjected()' on a null object reference
at android.graphics.drawable.LayerDrawable.isProjected(LayerDrawable.java:417)
at android.view.View.invalidateInternal(View.java:18121)
at android.view.View.invalidate(View.java:18070)
at android.view.View.setFrame(View.java:22656)
at com.android.internal.policy.DecorView.setFrame(DecorView.java:928)
at android.view.View.layout(View.java:22506)
at android.view.ViewGroup.layout(ViewGroup.java:7190)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:3456)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2916)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1964)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8721)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:988)
at android.view.Choreographer.doCallbacks(Choreographer.java:765)
at android.view.Choreographer.doFrame(Choreographer.java:700)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:967)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:216)
at android.os.HandlerThread.run(HandlerThread.java:65)
at com.android.server.ServiceThread.run(ServiceThread.java:44)
2021-08-10 11:10:41.731 8297-8297/? E/ConfigUpdater: ignoring update request
2021-08-10 11:10:41.748 8297-8297/? E/ConfigUpdater: ignoring update request
2021-08-10 11:10:41.759 8297-8297/? E/ConfigUpdater: ignoring update request
2021-08-10 11:10:41.771 8297-8297/? E/ConfigUpdater: ignoring update request
2021-08-10 11:10:41.776 8297-8297/? E/ConfigUpdater: ignoring update request
2021-08-10 11:10:41.785 8297-8297/? E/ConfigUpdater: ignoring update request
2021-08-10 11:10:41.797 8297-8297/? E/ConfigUpdater: ignoring update request
2021-08-10 11:10:42.041 2848-2872/? E/SurfaceFlinger: Failed to remove layer from mapping - could not find matching layer
2021-08-10 11:10:42.058 2848-4219/? E/SurfaceFlinger: Failed to remove layer from mapping - could not find matching layer
2021-08-10 11:10:42.058 2848-2872/? E/SurfaceFlinger: Failed to remove layer from mapping - could not find matching layer
2021-08-10 11:10:42.064 2848-2872/? E/SurfaceFlinger: Failed to remove layer from mapping - could not find matching layer
2021-08-10 11:10:42.086 4318-4318/? E/IconDB: getIcon exception : android.os.DeadSystemException
2021-08-10 11:10:42.088 3023-3023/? E/vendor.samsung.hardware.biometrics.fingerprint@2.1-service: BiometricsFingerprintDeathRecipient::serviceDied - Fingerprint Sevice died
2021-08-10 11:10:42.089 3781-3781/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.google.android.gms.persistent, PID: 3781
DeadSystemException: The system died; earlier logs will point to the root cause
2021-08-10 11:10:42.089 4365-4365/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.samsung.android.providers.context, PID: 4365
DeadSystemException: The system died; earlier logs will point to the root cause
2021-08-10 11:10:42.092 4318-4318/? E/IconDB: getIcon exception : android.os.DeadSystemException
2021-08-10 11:10:42.092 4318-4474/? E/AndroidRuntime: FATAL EXCEPTION: launcher-loader
Process: com.sec.android.app.launcher, PID: 4318
DeadSystemException: The system died; earlier logs will point to the root cause
2021-08-10 11:10:42.094 6898-7502/? E/JavaBinder: *** Uncaught remote exception! (Exceptions are not yet supported across processes.)
DeadSystemException: The system died; earlier logs will point to the root cause
2021-08-10 11:10:42.096 4318-4318/? E/IconDB: getIcon exception : android.os.DeadSystemException
2021-08-10 11:10:42.098 4318-4474/? E/DiagMonLog: File exists.
2021-08-10 11:10:42.100 4318-4318/? E/IconDB: getIcon exception : android.os.DeadSystemException
2021-08-10 11:10:42.105 4318-4318/? E/IconDB: getIcon exception : android.os.DeadSystemException
2021-08-10 11:10:42.105 3023-3023/? E/bauth_FPBAuthService: ~FPBAuthService : set_cancel_flags and sleep 200ms
2021-08-10 11:10:42.109 4318-4318/? E/IconDB: getIcon exception : android.os.DeadSystemException
2021-08-10 11:10:42.111 3781-3781/? E/GCore-Chimera-Crash: Hit an exception while processing the UncaughtExceptionHandler:
DeadSystemException: The system died; earlier logs will point to the root cause
DeadSystemException: The system died; earlier logs will point to the root cause
2021-08-10 11:10:42.118 3781-3781/? E/BaseUncaughtHandler: Hit an exception while processing the UncaughtExceptionHandler. Original exception:
DeadSystemException: The system died; earlier logs will point to the root cause
2021-08-10 11:10:42.133 4318-4318/? E/DiagMonLog: File exists.
2021-08-10 11:10:42.140 4318-5369/? E/DiagMonLog: File exists.
2021-08-10 11:10:42.156 4781-5358/? E/ExceptionReporter: Unchecked exception happened while running task: bk[SearchService stop]
DeadSystemException: The system died; earlier logs will point to the root cause
2021-08-10 11:10:42.169 4781-5358/? E/A: Encountered uncaught exception.
DeadSystemException: The system died; earlier logs will point to the root cause
2021-08-10 11:10:42.243 7490-7490/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.android.vending, PID: 7490
DeadSystemException: The system died; earlier logs will point to the root cause
2021-08-10 11:10:42.251 4781-4781/? E/ClientLoggingReceiver: Logging to Clearcut failed.
com.google.android.gms.common.api.n: 8:
at com.google.android.libraries.s.a.a(SourceFile:7)
at com.google.android.gms.common.api.internal.t.handleMessage(SourceFile:6)
at android.os.Handler.dispatchMessage(Handler.java:106)
at com.google.android.gms.h.c.c.c.b(SourceFile:1)
at com.google.android.gms.h.c.c.c.dispatchMessage(SourceFile:1)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7266)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
2021-08-10 11:10:42.252 4781-4781/? E/ClientLoggingReceiver: Logging to Clearcut failed.
com.google.android.gms.common.api.n: 20: The connection to Google Play services was lost due to service disconnection. Last reason for disconnect: Timing out service connection.
at com.google.android.libraries.s.a.a(SourceFile:7)
at com.google.android.gms.common.api.internal.t.handleMessage(SourceFile:6)
at android.os.Handler.dispatchMessage(Handler.java:106)
at com.google.android.gms.h.c.c.c.b(SourceFile:1)
at com.google.android.gms.h.c.c.c.dispatchMessage(SourceFile:1)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7266)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
2021-08-10 11:10:42.253 4781-4781/? E/ClientLoggingReceiver: Logging to Clearcut failed.
com.google.android.gms.common.api.n: 20: The connection to Google Play services was lost due to service disconnection. Last reason for disconnect: Timing out service connection.
at com.google.android.libraries.s.a.a(SourceFile:7)
at com.google.android.gms.common.api.internal.t.handleMessage(SourceFile:6)
at android.os.Handler.dispatchMessage(Handler.java:106)
at com.google.android.gms.h.c.c.c.b(SourceFile:1)
at com.google.android.gms.h.c.c.c.dispatchMessage(SourceFile:1)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7266)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
2021-08-10 11:10:42.275 4781-4927/? E/AndroidRuntime: FATAL EXCEPTION: GoogleApiHandler
Process: com.google.android.googlequicksearchbox:search, PID: 4781
DeadSystemException: The system died; earlier logs will point to the root cause
2021-08-10 11:10:42.275 4781-4927/? E/A: Encountered uncaught exception.
DeadSystemException: The system died; earlier logs will point to the root cause
2021-08-10 11:10:42.317 3023-3023/? E/TLC_BAUTH: *****************************
2021-08-10 11:10:42.317 3023-3023/? E/TLC_BAUTH: *** ERROR: TZ Session is not opened properly - Ignore
2021-08-10 11:10:42.317 3023-3023/? E/TLC_BAUTH: *** Detected in BAuth_Cancel/1519()
2021-08-10 11:10:42.317 3023-3023/? E/TLC_BAUTH: *****************************
2021-08-10 11:10:42.317 3023-3023/? E/bauth_FPBAuthService: ~FPBAuthService : BAuth_Cancel Fail
2021-08-10 11:10:42.324 3023-3023/? E/TLC_BAUTH: *****************************
2021-08-10 11:10:42.324 3023-3023/? E/TLC_BAUTH: *** ERROR: TZ Session is not opened properly - Ignore
2021-08-10 11:10:42.324 3023-3023/? E/TLC_BAUTH: *** Detected in BAuth_Control_OP/1620()
2021-08-10 11:10:42.324 3023-3023/? E/TLC_BAUTH: *****************************
2021-08-10 11:10:42.324 3023-3023/? E/bauth_FPBAuthService: check_opcode func_ret_val error = 29
2021-08-10 11:10:42.324 3023-3023/? E/(FPLOG): DeviceEnableInt 0 8 10 1
2021-08-10 11:10:42.325 3023-3023/? E/(FPLOG): 2.0.36.0 DeviceSetClock 0
2021-08-10 11:10:42.326 3606-3606/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.android.systemui, PID: 3606
DeadSystemException: The system died; earlier logs will point to the root cause
2021-08-10 11:10:42.638 8094-8094/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.google.android.apps.tachyon, PID: 8094
DeadSystemException: The system died; earlier logs will point to the root cause
[ 1628583042.657 8094: 8094 E/TY_com.google.android.libraries.processinit.finalizer.UncaughtExceptionHandlerProcessIn[005:262][8094] Encountered uncaught exception.
[ 1628583042.658 8094: 8094 E/TY_com.google.android.libraries.processinit.finalizer.UncaughtExceptionHandlerProcessIn[005:262][8094] java.lang.RuntimeException: android.os.DeadSystemException
[ 1628583042.658 8094: 8094 E/TY_com.google.android.libraries.processinit.finalizer.UncaughtExceptionHandlerProcessIn[005:262][8094] java.lang.RuntimeException: android.os.DeadSystemException
at android.app.ContextImpl.unbindService(ContextImpl.java:1786)
at android.content.ContextWrapper.unbindService(ContextWrapper.java:730)
at lkb.e(Unknown Source:0)
at lkb.b(PG:2)
at ljb.handleMessage(PG:9)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7266)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
Caused by: android.os.DeadSystemException
at android.app.ContextImpl.unbindService(ContextImpl.java:1786)
at android.content.ContextWrapper.unbindService(ContextWrapper.java:730)
at lkb.e(Unknown Source:0)
at lkb.b(PG:2)
at ljb.handleMessage(PG:9)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7266)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
2021-08-10 11:10:42.693 8035-8073/? E/AndroidRuntime: FATAL EXCEPTION: GoogleApiHandler
Process: com.google.android.apps.photos, PID: 8035
DeadSystemException: The system died; earlier logs will point to the root cause
2021-08-10 11:10:44.211 3020-3294/? E/AT_Distributor: HandleResponseOnError: Calling regeistered ErrorCallback(err = 4)
2021-08-10 11:10:44.212 3020-3294/? E/AT_Distributor: RIL RESET!!! reconnect to RIL
2021-08-10 11:10:44.294 3006-3056/? E/storaged: getDiskStats failed with result NOT_SUPPORTED and size 0
2021-08-10 11:10:44.296 8422-8422/? E/IptablesRestoreController: [iptables debug]iptables-restore execute *filter
:INPUT -
-F INPUT
:bw_INPUT -
-A INPUT -j bw_INPUT
:fw_INPUT -
-A INPUT -j fw_INPUT
:bw_VIDEOCALL_IN -
-A INPUT -j bw_VIDEOCALL_IN
COMMIT
2021-08-10 11:10:44.314 8422-8422/? E/IptablesRestoreController: [iptables debug]iptables-restore execute done, res : 0
2021-08-10 11:10:44.314 8422-8422/? E/IptablesRestoreController: [iptables debug]iptables-restore execute *filter
:FORWARD -
-F FORWARD
:oem_fwd -
-A FORWARD -j oem_fwd
:fw_FORWARD -
-A FORWARD -j fw_FORWARD
:bw_FORWARD -
-A FORWARD -j bw_FORWARD
:tetherctrl_FORWARD -
-A FORWARD -j tetherctrl_FORWARD
最佳答案
我遇到了同样的问题,因为我没有放任何 windowSplashScreenAnimatedIcon
对于 API < 31。我们需要一个,我们可以使用默认的一个。
在您的 styles.xml
上文件,编辑如下:
<style name="AppTheme.Splash" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/colorSecondary</item>
<item name="windowSplashScreenAnimatedIcon">@mipmap/ic_launcher_round</item>
<item name="postSplashScreenTheme">@style/AppTheme.SplashScreen</item>
</style>
我没有任何 API >= 31 的样式,它似乎以这种方式运行。
关于Android 12 API 31 启动画面 NullPointerException : Attempt to invoke virtual method 'boolean android. graphics.drawable.Drawable.isProjected(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68739211/
我正在尝试从文本文件构建 boolean 值[][]。我正在读取每个字符,存储在 ArrayList 中(1 为真,0 为假)。我试过 ArrayList,但出现编译错误,意外元素。因此,我构建了一个
我想知道编程语言中的运算符优先级是否取决于实现,还是所有语言都遵循固定的规则。并且,如果可能的话,您可以先排序以下具有最高优先级的运算符吗:AND,OR,NOT,XOR。 最佳答案 我在Google上
这是同样的事情,对吗?还是有细微的差别?我只是想确保我没有误解任何事情。 最佳答案 通过简单地将 AND 替换为 OR 以及将 OR 替换为 AND 即可生成 boolean 对偶。补码本身不受影响,
我想这对于大多数优秀的程序员来说是微不足道的,但我已经习惯使用 true 进行编程。和 false 2、当我遇到0和1的时候,我永远记不住哪一个是真的,哪一个是假的。 有什么建议? 1好:I mean
我正在尝试将此 Java 示例转换为 Kotlin: Gson gson = new GsonBuilder() .registerTypeAdapter(Boolean.class,
下面的代码打印 true。 public static void main(String[] args) { Boolean test = false; test =
我在处理应该导致在 iReport 中显示或隐藏 strip 的表达式时遇到困难。 这些是我拥有的变量: Integer mainGroupInt = Integer.valueOf(5); Inte
以下编码错误可能是因为 Boolean equals(Object) 方法不需要 boolean/Boolean 参数: private void foo() { Boolean isSome
我想简化一个 boolean 表达式。 表达式是这样的 X1 xor (X2 || X3 && X4 || x5) 如何使用 boolean 代数规则简化此表达式。 而且我想将上面的 boolean
我正在使用一些工具,它可以确定特定事务是否成功的唯一方法是它是否通过了各种检查。但是,它的方式有限制,一次只能做一次检查,而且必须是顺序的。一切都必须从左到右计算。 例如, A || C && D 它
在大多数编程语言中,1和 0可以用来代替 True和 False .然而,根据我的经验,整数似乎总是更容易使用。 以下是我的意思的一些示例: if x is True: x = False else:
我有一个 boolean 方程,想简化它。帮忙解决一下。 bool needLoad = isA || (!isA && !isB); 之后我使用 if (needLoad){ if (
我认为这始终是正确的 x || (x && y) 相当于 x 如果是这样,那条法律叫什么?我什至不知道如何通过 Google 搜索该信息。 最佳答案 它被称为 Redundancy Law . A +
是否有任何现有的方法或功能模块可以有效地翻转 boolean 值? 如果我必须定义自己的实用方法,我想出了一个简单的实现,但我想知道这是否是最有效的方法: IF iv_bool = abap_true
我有这个表达式:X'YZ'+X'YZ+XY'Z'+XYZ'+XYZ('表示不是)我知道答案是 Y+XZ' 但我陷入了最后一部分。有人可以帮我吗? 这是我到目前为止得到的: X'YZ' + X'YZ +
openCL 支持 boolean 变量吗?我目前正在使用 JOCL (java) 编写我的 openCL 调用代码,但我没有看到任何有关 boolean 值的信息。 最佳答案 tl;dr:是的,但您
我认为这是对的 x || (x && y) 相当于 x 如果是这样,那条法律叫什么?我什至不确定我会如何使用 Google。 最佳答案 它叫做 Redundancy Law . A + A·B = A
我有一些功能,例如 (A and ( B or c)) or (D and E and (F or H or R or P ))) 我想将该函数转换为仅包含 and 操作的函数(当然如果可能的话)我发
我参加了编程面试,由 3 名面试官组成,每人 45 分钟。虽然前两位面试官给了我 2-3 个简短的编码问题(即反向链表、使用 rand(5) 实现 rand(7) 等),但第三位面试官使用了整个时间段
如果我只想检查某事是否不可能(即,我不会使用类似 if(possible) 的东西),我应该将 boolean 值命名为 notPossible并使用 if(notPossible)或者我应该命名它p
我是一名优秀的程序员,十分优秀!