我正在使用Firebase動態鏈接,當我試圖使getShortLink崩潰時,使用名爲com.google.android.gms.common的FATAL EXCEPTION。 api.ApiException請幫我 這裏是我的代碼com.google.android.gms.common.api.ApiException while shorturl
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)
這是否一致?最好的辦法是使用https://firebase.google.com/support/contact/troubleshooting/提交一張票幷包含您的項目詳細信息,他們將能夠進行更多調查。 –