将Flutter应用程序部署到Google Play Store,但它卡在启动画面。

7

我将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>

2
你发布应用程序到Google Play之前,在发布模式下进行过测试吗? - fartem
你检查了吗? - mohammed fahmy
已经检查过了,看起来没问题。 - YoBo
1
我遇到了一个类似的错误,我的应用在上传到PlayStore后没有任何错误就崩溃了。你能分享一下你的gradle文件吗?我通过对那里的一些事情进行更改来解决我的问题。 - Preet Shah
1
你尝试在IDE中以生产模式运行应用程序了吗? - Alireza Abiri
显示剩余11条评论
5个回答

2

尝试以下操作

  1. 确保flutter doctor -v命令没有任何问题
  2. 编辑android/gradle.properties文件并添加标志:android.bundle.enableUncompressedNativeLibs=false
  3. 执行flutter clean命令
  4. 尝试使用flutter build appbundle创建发布版本

本地/离线测试

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

是否有效?

  1. 将您的应用程序包上传到Google Play使用内部测试轨道alphabeta渠道,在生产环境之前测试该包 有关如何执行此操作的说明,请参见此处

  2. 祝您好运 :)


2
假设您发布了一个App Bundle (.aab 文件),问题可能与格式本身有关,因为无法通过 IDE 进行测试。例如,当在设备上以 Release 模式运行应用程序时,会创建并提供 .apk 文件,而不是 .aab 文件。过去我解决 .aab 的方法(只在 GPlay 版本中失败,在本地 Debug 和 Release 模式下工作正常)是使用 Firebase Test Lab。您可以在每天免费的情况下在 5 个物理设备和 15 个虚拟设备上运行自动化猴子测试。只需登录 Firebase 控制台,创建一个空项目,进入“测试”,上传您的 .aab 文件,选择设备(也值得选择不同的区域设置),然后等待完成。之后,在测试结果中检查日志,您可能会在那里找到答案(在我的情况下,存在本地化资源问题,这在生成 .aab 发布包时被破坏)。这种选择可能比在本地使用命令行将 .aab 拆分为 APK 并在本地设备上进行测试更容易/更快。

1
因为在上传到Google Play后无法正常工作,那么您的应用签名可能存在问题。您可以按照此处链接中的步骤进行操作。

1

我在使用Facebook登录SDK时也遇到过类似的问题,因此建议检查以下内容:

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

  2. 检查是否在部署应用程序时选择了Google自动签名

    2.1 如果是,则会更改Facebook应用程序用于身份验证的sha-1值。为使其正常工作,请使用在Play商店中由Google生成的值。


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

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接