You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Google Play Console预启动报告重复闪屏问题求助

Google Play Console预启动报告重复闪屏警告问题求助

此前求助过该问题但描述不够清晰,目前Google Play Console预启动报告中持续收到重复闪屏警告——即使未使用SplashScreen API或相关Activity时也会触发。我创建了全新空项目,无论是否集成SplashScreen API,该警告仍存在。已尝试参考示例项目、同类未解决问题及官方迁移文档,但均未解决,希望能得到帮助以顺利发布应用。

相关代码与配置

MainActivity代码

package ro.li.test.myapplication;

import android.os.Bundle;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.splashscreen.SplashScreen;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

public class MainActivity extends AppCompatActivity {


    @Override
    protected void onCreate(Bundle savedInstanceState) {

        // 不管加不加这行都会出现警告
        SplashScreen.installSplashScreen(this);

        super.onCreate(savedInstanceState);
        simulateLoadingDelay();
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_main);

        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
            return insets;
        });
    }


    private void simulateLoadingDelay() {

        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}

splash.xml配置

<?xml version="1.0" encoding="utf-8"?>
<resources>

    <style name="Theme.App.Starting" parent="Theme.SplashScreen">
        <!-- 设置闪屏背景为白色 -->
        <item name="windowSplashScreenBackground">@android:color/white</item>
        <!-- 使用windowSplashScreenAnimatedIcon添加静态或动画Drawable -->
        <item name="windowSplashScreenAnimatedIcon">@drawable/face_animation_avd</item>
        <!-- 设置闪屏之后Activity的主题 -->
        <item name="postSplashScreenTheme">@style/Base.Theme.MyApplication</item>

    </style>
</resources>

manifest.xml配置

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <application
        android:allowBackup="true"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:fullBackupContent="@xml/backup_rules"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.App.Starting"
        tools:targetApi="31">

        <activity
            android:name=".MainActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

已尝试的参考资源

  • 官方SplashScreen API示例项目
  • 第三方库相关的同类未解决问题
  • Android官方闪屏迁移文档

内容的提问来源于stack exchange,提问作者Ronny Linde

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.27 21:58:31