Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UNAVAILABLE: Credentials failed to obtain metadata #13

Closed
shubh261096 opened this issue May 8, 2020 · 10 comments
Closed

UNAVAILABLE: Credentials failed to obtain metadata #13

shubh261096 opened this issue May 8, 2020 · 10 comments

Comments

@shubh261096
Copy link

Hi, I am getting this error while creating the release build in every project. When I am directly installing the app via Android Studio it works as expected, but generating the signed apk has some issue, always shows this error:

UNAVAILABLE: Credentials failed to obtain metadata

Please help in this!

@abhi007tyagi
Copy link
Owner

Try to change minify=false and see if it works

@Aishwarya0108
Copy link

May I please know the functionality of BuildConfig.ClientAccessToken please?

@shubh261096
Copy link
Author

@Aishwarya0108 If you using V1 API, then only you will need to add BuildConfig.ClientAccessToken in you build.gradle otherwise you won't have to add-in V2.

@shubh261096
Copy link
Author

@abhi007tyagi Any update on minifyEnabled thing?

@abhi007tyagi
Copy link
Owner

@shubh261096
add the following to your proguard rules

-keep public class com.google.a** {
  public protected *;
}

@shubh261096
Copy link
Author

shubh261096 commented Jun 12, 2020

@abhi007tyagi Didn't work. I tired on you your project.
Following below is the error:

    java.lang.ExceptionInInitializerError
        at c.b.a.a.a.a.a(:56)
        at c.b.a.a.a.t.<clinit>(:498)
        at c.b.a.a.a.r$g.internalGetFieldAccessorTable(:6797)
        at c.b.e.m1.getDescriptorForType(:133)
        at c.b.e.h4$d.a(:344)
        at c.b.e.h4$d.a(:334)
        at c.b.e.h4$d.a(:519)
        at c.b.e.a.toString(:111)
        at java.lang.String.valueOf(String.java:2924)
        at java.lang.StringBuilder.append(StringBuilder.java:132)
        at com.tyagiabhinav.dialogflowchat.MainActivity.a(:145)
        at com.tyagiabhinav.dialogflowchat.d.a(:50)
        at com.tyagiabhinav.dialogflowchat.d.onPostExecute(:19)
        at android.os.AsyncTask.finish(AsyncTask.java:755)
        at android.os.AsyncTask.access$900(AsyncTask.java:192)
        at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:772)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
     Caused by: java.lang.RuntimeException: Generated message class "c.b.e.z$p" missing method "getCtype".
        at c.b.e.m1.b(:1847)
        at c.b.e.m1.a(:79)
        at c.b.e.m1$g$h$b.<init>(:2154)
        at c.b.e.m1$g$h.<init>(:2222)
        at c.b.e.m1$g$g.<init>(:2717)
        at c.b.e.m1$g.a(:1973)
        at c.b.e.z$p.internalGetFieldAccessorTable(:28293)
        at c.b.e.m1.getDescriptorForType(:133)
        at c.b.e.m1$e.parseUnknownField(:1134)
        at c.b.e.z$p.<init>(:28263)
        at c.b.e.z$p.<init>(:28162)
        at c.b.e.z$p$a.b(:30224)
        at c.b.e.z$p$a.b(:30218)
        at c.b.e.u$b.a(:888)
        at c.b.e.z$n.<init>(:11537)
        at c.b.e.z$n.<init>(:11429)
        at c.b.e.z$n$a.b(:13946)
        at c.b.e.z$n$a.b(:13940)
        at c.b.e.u$b.a(:888)
        at c.b.e.z$b.<init>(:5186)
        at c.b.e.z$b.<init>(:5122)
        at c.b.e.z$b$a.b(:10193)
        at c.b.e.z$b$a.b(:10187)
        at c.b.e.u$b.a(:888)
        at c.b.e.z$r.<init>(:1276)
        at c.b.e.z$r.<init>(:1196)
        at c.b.e.z$r$a.b(:4846)
        at c.b.e.z$r$a.b(:4840)
        at c.b.e.c.b(:158)
        at c.b.e.c.a(:191)
        at c.b.e.c.a(:203)
        at c.b.e.c.a(:208)
        at c.b.e.c.a(:48)
        at c.b.e.z$r.parseFrom(:2255)
        at c.b.e.a0$h.a(:410)
        at c.b.a.a.a.a.<clinit>(:118)
        at c.b.a.a.a.a.a(:56) 
        at c.b.a.a.a.t.<clinit>(:498) 
        at c.b.a.a.a.r$g.internalGetFieldAccessorTable(:6797) 
        at c.b.e.m1.getDescriptorForType(:133) 
        at c.b.e.h4$d.a(:344) 
        at c.b.e.h4$d.a(:334) 
        at c.b.e.h4$d.a(:519) 
        at c.b.e.a.toString(:111) 
        at java.lang.String.valueOf(String.java:2924) 
        at java.lang.StringBuilder.append(StringBuilder.java:132) 
        at com.tyagiabhinav.dialogflowchat.MainActivity.a(:145) 
        at com.tyagiabhinav.dialogflowchat.d.a(:50) 
        at com.tyagiabhinav.dialogflowchat.d.onPostExecute(:19) 
        at android.os.AsyncTask.finish(AsyncTask.java:755) 
        at android.os.AsyncTask.access$900(AsyncTask.java:192) 
        at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:772) 
        at android.os.Handler.dispatchMessage(Handler.java:107) 
        at android.os.Looper.loop(Looper.java:214) 
        at android.app.ActivityThread.main(ActivityThread.java:7356) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) 
     Caused by: java.lang.NoSuchMethodException: c.b.e.z$p.getCtype []
        at java.lang.Class.getMethod(Class.java:2072)
        at java.lang.Class.getMethod(Class.java:1693)```

@shubh261096
Copy link
Author

Error got from Firebase Crashlytics:

Fatal Exception: java.lang.RuntimeException: Generated message class "com.google.cloud.dialogflow.v2.DetectIntentResponse$Builder" missing method "getResponseId".
       at com.google.protobuf.GeneratedMessageV3.getMethodOrDie(GeneratedMessageV3.java:3)
       at com.google.protobuf.GeneratedMessageV3.access$1000(GeneratedMessageV3.java:1)
       at com.google.protobuf.GeneratedMessageV3$FieldAccessorTable$SingularFieldAccessor$ReflectionInvoker.<init>(GeneratedMessageV3.java:3)
       at com.google.protobuf.GeneratedMessageV3$FieldAccessorTable$SingularFieldAccessor.<init>(GeneratedMessageV3.java:5)
       at com.google.protobuf.GeneratedMessageV3$FieldAccessorTable$SingularStringFieldAccessor.<init>(GeneratedMessageV3.java:1)
       at com.google.protobuf.GeneratedMessageV3$FieldAccessorTable.ensureFieldAccessorsInitialized(GeneratedMessageV3.java:22)
       at com.google.cloud.dialogflow.v2.DetectIntentResponse.internalGetFieldAccessorTable(DetectIntentResponse.java:2)
       at com.google.protobuf.GeneratedMessageV3.getDescriptorForType(GeneratedMessageV3.java:1)
       at com.google.protobuf.TextFormat$Printer.print(TextFormat.java:3)
       at com.google.protobuf.TextFormat$Printer.print(TextFormat.java:1)
       at com.google.protobuf.TextFormat$Printer.printToString(TextFormat.java:2)
       at com.google.protobuf.AbstractMessage.toString(AbstractMessage.java:1)
       at com.kings.retailapp.chatbot.ChatbotActivity.callbackV2(ChatbotActivity.java:1)
       at com.kings.retailapp.chatbot.ChatbotActivity.a(ChatbotActivity.java:2)
       at com.kings.retailapp.chatbot.a.onChanged(:4)
       at androidx.lifecycle.LiveData.considerNotify(LiveData.java:6)
       at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:8)
       at androidx.lifecycle.LiveData.setValue(LiveData.java:4)
       at androidx.lifecycle.MutableLiveData.setValue(MutableLiveData.java:1)
       at androidx.lifecycle.LiveData$1.run(LiveData.java:5)
       at android.os.Handler.handleCallback(Handler.java:794)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:176)
       at android.app.ActivityThread.main(ActivityThread.java:6651)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)

@abhi007tyagi
Copy link
Owner

@shubh261096 I can't say about Firebase! It is working at my end.
You may try to add the following:
If still, it is not working, you spend some time on proguard settings for your project!

-keep public class com.google.api.gax.core.** {
  public protected *;
}
-keep public class com.google.auth.oauth2.** {
  public protected *;
}

@shubh261096
Copy link
Author

@abhi007tyagi Thanks. It was proguard problem on my end too. Finally did it.

@abhi007tyagi
Copy link
Owner

@shubh261096 @Aishwarya0108 try my latest library for easy integration of Chatbot
https://medium.com/@abhi007tyagi/android-dialogflow-chatbot-library-6b7b3822e7bc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants