简短的动态链接错误com.google.android.gms.common.api.ApiException:8: [英] Short Dynamic link error com.google.android.gms.common.api.ApiException: 8:

查看:132
本文介绍了简短的动态链接错误com.google.android.gms.common.api.ApiException:8:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试让Firebase动态链接在我的应用中正常工作.

I am trying to get Firebase dynamic links to work in my app.

我具有以下功能

    //long
    String link = "http://www.blessd.mobi";
    DynamicLink m = FirebaseDynamicLinks.getInstance().createDynamicLink()
            .setLink(Uri.parse(link))
            .setDynamicLinkDomain("blessd.page.link")
            .setAndroidParameters(
                    new DynamicLink.AndroidParameters.Builder("mobi.blessd")
                            .build())
            .buildDynamicLink();
    Uri t = m.getUri();
    String ll = t.toString();
    Log.d(TAG + " long link:", ll);

    //short
    Task<ShortDynamicLink> shortLinkTask = FirebaseDynamicLinks.getInstance().createDynamicLink()
            .setLink(Uri.parse("http://www.blessd.mobi"))
            .setDynamicLinkDomain("blessd.page.link")
            .setAndroidParameters(
                    new DynamicLink.AndroidParameters.Builder("mobi.blessd")
                            .build())
            .buildShortDynamicLink()
            .addOnCompleteListener(this, new OnCompleteListener<ShortDynamicLink>() {
                @Override
                public void onComplete(@NonNull Task<ShortDynamicLink> task) {
                    if (task.isSuccessful()) {
                        // Short link created
                        Uri shortLink = task.getResult().getShortLink();
                        Uri flowchartLink = task.getResult().getPreviewLink();
                        String sl = shortLink.toString();
                        String fcl = flowchartLink.toString();
                        Log.d(TAG + " short link:", sl);
                        Log.d(TAG + " flow chat link:", fcl);
                    } else {
                        // Error
                        // ...
                        Log.d(TAG + " short links:", "problem");
                        Exception exception = task.getException();
                        Log.e("TAG", "Short Dynamic link error", exception);
                    }
                }
            });

我成功生成了一个长链接.我已经在网络浏览器中以调试模式调试了长链接, 没有错误.

I successfully generate a long link. I have debugged the long link in debug mode in a web browser and there are no errors.

但是短链接无法运行,并且我收到以下错误消息:

The short link however does not run and I receive the following error:

09-03 16:14:06.816 4551-4551/? E/TAG:短动态链接错误 com.google.android.gms.common.api.ApiException:8:

09-03 16:14:06.816 4551-4551/? E/TAG: Short Dynamic link error com.google.android.gms.common.api.ApiException: 8:

谢谢.

推荐答案

Firebase团队能够重现此问题,并且已经将此问题报告给了他们的团队.

Firebase team was able to reproduce the issue and has already reported this to their team.

当前,此问题有两种解决方法:

Currently, there are two workarounds for this issue:

  • 使用动态链接版本 16.0.1 可以生成简短的动态链接: implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.firebase:firebase-dynamic-links:16.0.1'

  • Use the Dynamic Link version 16.0.1 to be able to generate a short Dynamic Link: implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.firebase:firebase-dynamic-links:16.0.1'

使用版本 16.1.1 进行插入,首先创建一个长链接,然后尝试使用此

Stick in using version 16.1.1, create a long link first then try to shorten the long Dynamic Link using this guide.

这篇关于简短的动态链接错误com.google.android.gms.common.api.ApiException:8:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆