【问题标题】:Deployed Flutter application to Google Play Store but it's stuck at the splash screen将 Flutter 应用程序部署到 Google Play 商店,但它卡在初始屏幕上
【发布时间】:2021-05-23 17:40:13
【问题描述】:

已将 Flutter 应用程序部署到 Google Play 商店,但它卡在初始屏幕上并且永远无法打开 我确实匹配了我的 AppID,但仍然面临同样的问题

这是我的 manifest.xml:

<!-- TODO: Changed by Parveen Before merge 1 -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.mrbox.store">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <!--
    io.flutter.app.FlutterApplication is an android.app.Application that
    calls FlutterMain.startInitialization(this); in its onCreate method.
    In most cases you can leave this as-is, but you if you want to provide
    additional functionality it is fine to subclass or reimplement
    FlutterApplication and put your custom class here.
    -->
    <!-- TODO: Add By Parveen before merge 1 -->
    <application
        android:name="io.flutter.app.FlutterApplication"
        android:label="Mr.Box Store"
        android:usesCleartextTraffic="true"
        android:icon="@mipmap/launcher_icon">
        <activity
            android:name=".MainActivity"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <!--
            Specifies an Android theme to apply to this Activity as soon as
            the Android process has started. This theme is visible to the user
            while the Flutter UI initializes. After that, this theme continues
            to determine the Window background behind the Flutter UI.
            -->
            <meta-data
                android:name="io.flutter.embedding.android.NormalTheme"
                android:resource="@style/NormalTheme"
                />
            <!--
            Displays an Android View that continues showing the launch screen
            Drawable until Flutter paints its first frame, then this splash
            screen fades out. A splash screen is useful to avoid any visual
            gap between the end of Android's launch screen and the painting of
            Flutter's first frame.
            -->
            <meta-data
                android:name="io.flutter.embedding.android.SplashScreenDrawable"
                android:resource="@drawable/launch_background"
                />
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <intent-filter>
                <action android:name="FLUTTER_NOTIFICATION_CLICK" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <!--
            TODO: Changed by parveen before merge 1
            android:name="default-url"
            android:value="https://inspireui.com"
            -->
            <meta-data
                android:name="default-url"
                android:value="https://www.mrboxstore.com" />
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <!-- TODO: Changed by parveen before merge 1 android:value="inspireui.com" -->
                <data android:scheme="https"
                    android:host="mrboxstore.com" />
                <data android:scheme="http" />
            </intent-filter>
        </activity>
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_icon"
            android:resource="@drawable/logo" />
        <!--
        Set color used with incoming notification messages. This is used when no color is set for the incoming
        notification message. 
        -->
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_color"
            android:resource="@color/notiColor" />
        <!-- Google map and Admod setup -->
        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="@string/api_key" />
        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="@string/admob_api" />
        <!-- Facebook Login configuration -->
        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/facebook_app_id" />
        <activity
            android:name="com.facebook.FacebookActivity"
            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
            android:label="@string/app_name"
            android:exported="true" />
        <activity
            android:name="com.facebook.CustomTabActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="@string/fb_login_protocol_scheme" />
            </intent-filter>
        </activity>
        <!--
        Don't delete the meta-data below.
        This is used by the Flutter tool to generate GeneratedPluginRegistrant.java
        -->
        <meta-data android:name="flutterEmbedding"
            android:value="2" />
    </application>
</manifest>

【问题讨论】:

  • 在发布到 Google Play 之前,您在发布模式下测试过应用程序吗?
  • 我做到了,而且效果很好
  • 你能分享清单吗?
  • 我有一个类似的错误,我的应用程序在上传到 PlayStore 时才会崩溃而没有任何错误。你能分享你的gradle 文件吗?我通过改变那里的一些东西来解决我的问题。
  • 您是否尝试过在 IDE 中以生产模式运行您的应用程序?

标签: flutter android-studio google-play


【解决方案1】:

尝试的事情

  1. 确保 flutter doctor -v 在没有任何投诉的情况下运行
  2. 编辑 android/gradle.properties 并添加标志:android.bundle.enableUncompressedNativeLibs=false
  3. 执行flutter clean 命令
  4. 尝试使用flutter build app bundle 创建发布版本

本地/离线测试

  1. 下载bundletool
  2. 根据this guide 从您的应用程序包中生成一组 APK
  3. 按照Guide 将应用程序部署到您连接的设备上

有效吗?

  1. 使用internal test trackalphabeta 频道将您的捆绑包上传到 Google Play,以便在将捆绑包发布到生产环境之前对其进行测试 可以在here

    找到执行此操作的说明
  2. 祝你好运:)

【讨论】:

    【解决方案2】:

    因为在 google play 上传后无法正常工作。那么您的应用签名可能存在一些问题。可以按照步骤here

    【讨论】:

      【解决方案3】:

      我在使用 facebook login sdk 时遇到过这样的问题,所以我建议检查以下内容:

      1. 检查您是否使用正确的发布密钥库签署了 apk/appbundle

      2. 在部署应用时检查您是否选择了 Google 在 Playstore 上的自动登录

        2.1 如果是,那么它将更改 facebook 应用程序中用于身份验证的 sha-1 值,以便使用 google 在 playstore 中生成的值

      【讨论】:

        【解决方案4】:

        假设您发布了一个 App Bundle(.aab 文件),该问题可能与格式本身有关,因为它无法通过 IDE 进行测试。例如。在设备上以发布模式运行应用程序时,会创建并配置 .apk,而不是 .aab。

        我过去对 .aab 进行故障排除(也仅在 GPlay 版本中出现故障,本地调试和发布模式运行良好)是使用 Firebase 测试实验室。您可以每天免费在 5 台物理设备和 15 台虚拟设备上运行自动化猴子测试。只需登录 Firebase 控制台,创建一个空项目,转到测试,上传您的 .aab 文件,选择设备(也值得选择不同的语言环境)并等待完成。在检查记录测试结果之后,您可能会在那里找到答案(在我的情况下,本地化资源出现问题,在生成 .aab 发布包时被破坏)。

        与使用命令行在本地将 .aab 拆分为 APK 并在本地设备上进行测试相比,此选项更容易/更快。

        【讨论】:

          【解决方案5】:

          根据我的经验,请尝试检查您的数据库(sqlite)是否已创建。尝试替换路径并检查数据库是否创建正确。

          【讨论】:

            猜你喜欢
            • 2015-05-21
            • 2021-06-24
            • 1970-01-01
            • 2022-12-19
            • 2020-10-13
            • 1970-01-01
            • 2013-02-15
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多