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

Something went wrong while trying to deserialize a response from the server #17

Closed
Tolansoft opened this issue Dec 17, 2023 · 10 comments
Closed
Assignees
Labels
type:bug Something isn't working

Comments

@Tolansoft
Copy link

Tolansoft commented Dec 17, 2023

When testing app from Google Play console internal test channel with release build with ;

        minifyEnabled true
        shrinkResources true

"Something went wrong while trying to deserialize a response from the server" error occurs on Model answer

There is no Logcat info on Android Studio when it occurs.

What i tried is : Added lines below to my proguard-rules.pro

-keep class androidx.compose.ui.*.*{*;} -keep class com.google.ai.*.*{*;}

but not works

Thank you!

@rlazo
Copy link
Collaborator

rlazo commented Dec 19, 2023

Hi @Tolansoft thanks for your report. Is this an error you are seeing consistently across different executions and using different prompts? or is it restricted to some use cases?

@rlazo rlazo added the needs-info More information is needed from the reporter label Dec 19, 2023
@Tolansoft
Copy link
Author

Tolansoft commented Dec 19, 2023 via email

@rlazo
Copy link
Collaborator

rlazo commented Dec 19, 2023

@emilypgoogle could you please take a look? Thanks!

@emilypgoogle
Copy link
Collaborator

Will do

@rlazo rlazo added type:bug Something isn't working and removed needs-info More information is needed from the reporter labels Dec 19, 2023
@emilypgoogle
Copy link
Collaborator

I believe this is an issue of misconfigured proguard rules, a large amount of our internal classes are obfuscated with the rules you've posted. Several internal types rely on automatic serialization based on symbol names, so you'll need to not obfuscate them. Try -keep class com.google.ai.** {*;} or similar. For more testing with proguard exclusions, you can use https://playground.proguard.com/

@rlazo rlazo reopened this Dec 21, 2023
@rlazo
Copy link
Collaborator

rlazo commented Dec 21, 2023

Hey @Tolansoft PR #23 fixes the issue by shipping the right proguard.txt as part of the SDK. This will be part of the next release. In the meanwhile, following @emilypgoogle advice on the comment above is a viable workaround. Once again, thanks for your report!

@Tolansoft
Copy link
Author

Hey Rodrigo and Emily and thanks for fixing it!

@rlazo
Copy link
Collaborator

rlazo commented Dec 21, 2023

#23 merged

@rlazo rlazo closed this as completed Dec 21, 2023
@Micoder-dev
Copy link

It will be better if you add the -keep class com.google.ai.** {*;} rule in the readme, Thank you!

@emitchel
Copy link

@davidmotson I see you're working on serialization in your branch, I still see this serialization error response even though the first flow emission is of a valid response.

looks like it's having a hard time parsing out the following response (no surprise - I wouldn't expect this invalid json either),

data: {"candidates": [{"content": {"parts": [{"text": " This is a photo of a group of people who work together. They are posing in front of a mural of a forest."}],"role": "model"},"finishReason": "STOP","index": 0,"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}],"promptFeedback": {"safetyRatings": [{"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HATE_SPEECH","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_HARASSMENT","probability": "NEGLIGIBLE"},{"category": "HARM_CATEGORY_DANGEROUS_CONTENT","probability": "NEGLIGIBLE"}]}}

{
  "error": {
    "code": 500,
    "message": "An internal error has occurred. Please retry or report in. 
   https://developers.generativeai.google/guide/troubleshooting",
    "status": "INTERNAL"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants