0

我遇到了一个在这里被广泛讨论的问题。你需要在这个活动中使用 Theme.AppCompat 主题(或后代)

我的 style.xml 文件包含以下配置。

<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting -->
<style name="LaunchTheme" parent="Theme.AppCompat.Light">
    <!-- Show a splash screen on the activity. Automatically removed when
         Flutter draws its first frame -->
    <item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
     This theme determines the color of the Android Window while your
     Flutter UI initializes, as well as behind your Flutter UI while its
     running.

     This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="Theme.AppCompat.Light">
    <item name="android:windowBackground">@android:color/white</item>
</style>

我已经尝试过各种主题:Theme.AppCompat.Light、Theme.AppCompat、Theme.AppCompat.Light、Theme.AppCompat.NoActionBar、Theme.AppCompat.Light.NoActionBar,但没有任何效果。

最后,我确定了产生错误的原因。

我在我的应用程序中使用了放大,并且配置是按照这里https://docs.amplify.aws/start/getting-started/integrate/q/integration/flutter中的描述实现的。

我发现如果我评论放大配置,则不再生成错误。

以下是允许放大配置时发生的错误。没有可以触发以下错误的特定操作,事件是突然触发的。此外,当问题发生时,屏幕上会出现一个名为“Amplify Developer Menu”的菜单。

E/HW-JPEG-DEC(32740): [HME_JPEG_DEC_Delete](3321): HME_JPEG_DEC_Delete: decoder_ctx=null
E/HW-JPEG-DEC(32740): [HME_JPEG_DEC_Delete](3321): HME_JPEG_DEC_Delete: decoder_ctx=null
E/HW-JPEG-DEC(32740): [HME_JPEG_DEC_Delete](3321): HME_JPEG_DEC_Delete: decoder_ctx=null
E/HW-JPEG-DEC(32740): [HME_JPEG_DEC_Delete](3321): HME_JPEG_DEC_Delete: decoder_ctx=null
E/HW-JPEG-DEC(32740): [HME_JPEG_DEC_Delete](3321): HME_JPEG_DEC_Delete: decoder_ctx=null
E/ThemeUtils(32740): View class androidx.appcompat.widget.AppCompatTextView is an AppCompat 
widget that can only be used with a Theme.AppCompat theme (or descendant).
W/ResourceType(32740): Too many attribute references, stopped at: 0x01010034
E/ThemeUtils(32740): View class androidx.appcompat.widget.AppCompatImageButton is an 
AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant).

如果有帮助,我在华为 P9 lite 上进行了测试。

4

0 回答 0