1

我正在尝试让我的应用程序使用应用程序链接,但即使我完成了所有步骤并且assetlinks.json正在请求我的文件,消歧框仍然出现。我用一个原生的 android 应用程序尝试了相同的步骤,它在没有显示框的情况下工作。这是我所做的:

1-创建一个新的颤振应用程序。2-按照https://flutter.dev/docs/deployment/android上的说明签署我的应用程序 3-将以下内容添加到我的活动中AndroidManifest.xml

<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:scheme="https"
                    android:host="<example.come>" />
            </intent-filter>

我替换example.com为我自己的域,启用了 https 并提供服务/.well-known/assetlinks.json

这里是内容assetlinks.json

[
    {
        "relation": [
            "delegate_permission/common.handle_all_urls"
        ],
        "target": {
            "namespace": "android_app",
            "package_name": "com.example.app",
            "sha256_cert_fingerprints": [
                "hash_of_app_certificate"
            ]
        }
    }
]

com.example.app用自己的替换,并更改了哈希。我用这个命令来获取哈希 keytool -list -v -keystore <keystore path> -alias <key alias> -storepass <store password> -keypass <key password>

4-flutter build apk在我的设备上运行并安装该应用程序。我可以看出assetlinks.json已经从服务器请求,但选择框仍然出现。

assertlinks.jsonhttps://developers.google.com/digital-asset-links/tools/generator上测试了我的,它说它是成功的,所以无论是什么错误都在应用程序方面。

我错过了什么或做错了什么?

这是我的flutter doctor --verbose

[√] Flutter (Channel stable, 1.22.5, on Microsoft Windows [Version 10.0.19041.746], locale en-US)
    • Flutter version 1.22.5 at C:\flutter
    • Framework revision 7891006299 (7 weeks ago), 2020-12-10 11:54:40 -0800
    • Engine revision ae90085a84
    • Dart version 2.10.4

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at C:\Users\Moneer\AppData\Local\Android\Sdk
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = C:\Users\Moneer\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[!] Android Studio (version 4.1.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.52.1)
    • VS Code at C:\Users\Moneer\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.18.1

[√] Connected device (1 available)
    • sdk gphone x86 64 arm64 (mobile) • emulator-5554 • android-x64 • Android 11 (API 30) (emulator)

! Doctor found issues in 1 category.

4

0 回答 0