2

我有一个尚未公开发布的 Android 应用程序。我想使用 Play 商店的“内部测试”渠道将其分发给客户端。

我在该频道中创建了版本,复制了安装链接,通过链接安装了应用程序,到目前为止一切顺利。首先可疑的是,安装后应用的Play Store页面没有打开按钮,只有卸载按钮:

在此处输入图像描述 然后最大的问题是,当我尝试通过单击其图标来打开应用程序时,而不是实际打开应用程序(查看应用程序的 UI),会显示此屏幕:

在此处输入图像描述

你有没有遇到过这样的事情?问题出在哪里?

编辑:

我尝试将应用程序作为 .apk 文件分发,但在从此类文件安装后会发生完全相同的事情:点击应用程序的图标会打开下面的设置页面,而不是应用程序本身。

我怀疑这可能与应用程序签名有关...

编辑2:

添加我的应用程序的 Android 清单 ( /app/main/AndroidManifest.xml):

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.ariva">
   <application
        android:label="ARIVA dev"
        android:icon="@mipmap/ic_launcher">
        <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">
            <meta-data
              android:name="io.flutter.embedding.android.NormalTheme"
              android:resource="@style/NormalTheme"
              />
            <meta-data
              android:name="io.flutter.embedding.android.SplashScreenDrawable"
              android:resource="@drawable/launch_background"
              />
            <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="http" android:host="arivadev.page.link" />
                <data android:scheme="https" android:host="arivadev.page.link" />
            </intent-filter>
        </activity>
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
</manifest>

编辑 3

根据一些评论和答案,将单个过滤器替换为intent-filter2 个单独的过滤器。现在该应用程序已通过 Play 商店安装就好了。但是,作为副作用,用于对用户进行身份验证的 Firebase 动态链接停止工作。更具体地说,单击电子邮件链接会在直接从 Android Studio 安装时打开应用程序,但在通过 Play 商店安装应用程序时不会打开应用程序(而是打开备份网站)。

因此,这不是一个可行的解决方案,除非动态链接也正常工作。这是新版本的intent-filters:

<intent-filter>
    <action android:name="android.intent.action.MAIN"/>
    <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<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"/>
    <data android:host="arivadev.page.link" android:scheme="http"/>
    <data android:host="arivadev.page.link" android:scheme="https"/>
</intent-filter>
4

3 回答 3

1

我认为问题出在下面。

<data android:scheme="http" android:host="arivadev.page.link" />
<data android:scheme="https" android:host="arivadev.page.link" />

当我将此行添加到我的 Android 清单时。我遇到同样的问题。所以请评论这行并再次测试。


您也可以按照以下答案添加data标签。(带有单独的意图过滤器)

https://stackoverflow.com/a/40543872/6813907

于 2021-11-11T10:46:11.883 回答
1

编辑:请参阅此答案的最后一部分。它应该可以解决问题。

我怀疑这是 Android 特有的问题,您的 Flutter 代码没问题。最大的原因可能是,Android 不认为你有一个 Activity。

通过 Android Studio 安装 Android 应用程序时有效

恕我直言,这可能是因为 android studio 使用特殊命令来启动它喜欢的活动,这与 android 在用户点击应用程序时所做的不同。

我尝试将应用程序作为 .apk 文件分发,但在从此类文件安装后会发生完全相同的事情:点击应用程序的图标会打开下面的设置页面,而不是应用程序本身。

那么这也不是 Google Play 的问题。

请问可以上传你的apk文件吗?然后我们可以看一下(比如直接用Android Studio部分反编译看看结果AndroidManifests.xml。AndroidManifest.xml的结果确实和你上面显示的不一样,因为android构建系统会自动添加一些其他的东西到那个xml,你的错误可能是由它引起的。)

此外,您能否(暂时)将您的 AndroidManifests.xml 替换为 Flutter 使用生成的文件flutter create mynewproject?这将有助于确定该文件是否正常。

最后但并非最不重要的一点是,您的意图过滤器似乎不正确。您在一个过滤器中过滤掉了太多东西,因此启动与此过滤器不匹配。相反,您可能需要了解意图过滤器的定义,并创建多个单独的过滤器。或者,请提供需要您添加这些过滤器的软件包的链接(这可能是一个错误)。

编辑

你能试试:

<intent-filter>
    <action android:name="android.intent.action.MAIN"/>
    <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter android:autoVerify="true">
    <action android:name="android.intent.action.MAIN"/>
    <category android:name="android.intent.category.LAUNCHER"/>
    <action android:name="android.intent.action.VIEW"/>
    <category android:name="android.intent.category.DEFAULT"/>
    <category android:name="android.intent.category.BROWSABLE"/>
    <data android:host="arivadev.page.link" android:scheme="http"/>
    <data android:host="arivadev.page.link" android:scheme="https"/>
</intent-filter>

请注意 firebase 如何在其文档中提到集成:

为深层链接添加意图过滤器

与普通深层链接一样,您必须向处理应用程序深层链接的活动添加一个新的意图过滤器。意图过滤器应该捕获您的域的深层链接,因为如果安装了您的应用程序,动态链接将重定向到您的域。这是您的应用在从 Play 商店安装/更新后接收动态链接数据所必需的,并且点击继续按钮。在 AndroidManifest.xml 中:

嘿,它要求添加一个新的意图过滤器!因此,恕我直言,您应该(1)保留由颤振生成的普通旧意图过滤器,以及(2)添加的意图过滤器而不修改旧的意图过滤器。我上面的最新示例代码演示了该怎么做。

于 2021-11-11T09:10:05.637 回答
0

如果您选择了 Google 唱歌,那么当您从 Google Play 安装应用程序时,sha1 会有所不同。确保从 Google Play 控制台复制 sha1 并将其添加到 firebase。下载 Googleservices.json 并再次更新 a​​pk。

于 2021-11-13T01:48:25.983 回答