gpt4 book ai didi

android - 制作 shorturl 时出现 com.google.android.gms.common.api.ApiException

转载 作者:太空宇宙 更新时间:2023-11-03 12:14:33 25 4
gpt4 key购买 nike

我正在使用 firebase 动态链接,当我尝试获取 ShortLink 时它因名为 com.google.android.gms.common.api.ApiException 的致命异常而崩溃,请帮助我这是我的代码

private void buildReferralLink() {
//https://j8b99.app.goo.gl/
String domain = "j8b99" + ".app.goo.gl";

DynamicLink.Builder builder = FirebaseDynamicLinks.getInstance()
.createDynamicLink()
.setDynamicLinkDomain(domain)
.setAndroidParameters(new DynamicLink.AndroidParameters.Builder()
.setMinimumVersion(BuildConfig.VERSION_CODE)
.build())
.setLink(Uri.parse("https://play.google.com/store/apps/details?id=com.games4playstore.aroundyou"));

builder.buildShortDynamicLink().addOnCompleteListener(this, new OnCompleteListener<ShortDynamicLink>() {
@Override
public void onComplete(@NonNull Task<ShortDynamicLink> task) {
Uri shortLink = task.getResult().getShortLink();
Log.e("test", "ShortLink: " + shortLink);
}
});
}

这是我的崩溃报告

07-28 17:19:22.526 21231-21231/com.games4playstore.aroundyou E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.games4playstore.aroundyou, PID: 21231
com.google.android.gms.tasks.RuntimeExecutionException: com.google.android.gms.common.api.ApiException
at com.google.android.gms.tasks.zzn.getResult(Unknown Source)
at com.games4playstore.aroundyou.MainActivity$3.onComplete(MainActivity.java:160)
at com.google.android.gms.tasks.zzf.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6946)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by: com.google.android.gms.common.api.ApiException
at com.google.android.gms.internal.zzbeq.zza(Unknown Source)
at com.google.android.gms.internal.zg.zza(Unknown Source)
at com.google.android.gms.internal.zl.onTransact(Unknown Source)
at android.os.Binder.execTransact(Binder.java:446)

最佳答案

这是 Android 上动态链接服务器端的一个问题 - 它已经解决,应该很快就会推出修复程序。

关于android - 制作 shorturl 时出现 com.google.android.gms.common.api.ApiException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45372897/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com