-
Notifications
You must be signed in to change notification settings - Fork 594
Proguard Enabled - Google Speech-to-Text API stopped working #120
Comments
Ran into the same problem. For
The following configuration works:
It would be awesome if the samples would include the most optimal Proguard configuration. |
Another issue wi proguard is with Text-to-speech library. Issue was due to Java Gax which is used to get library version. Done in Speech and TextToSpeech as well. It uses package information but since proguard strips the package it will return null and gax will not be able to figure out library version. Call site gets package (will be null) and it calls
Adding this line to proguard configuration solves the issue:
Or you can just keep the whole text to speach package to be sure.
First option solves Gax issue and second keeps it not obfuscated as a whole which makes them both not optimal solutions since there might be more issues than just the one with Gax and it is also not optimal to keep the whole package un-obfuscated. Bottom line is: as @dejandobnikar said it would be awesome if each library would contain optimal Proguard configuration. |
Hi,
Google Speech-to-Text API stopped working when progurard is enabled in Android app.
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
I am using Speech-to-Text Client Libraries. App's Gradle file dependencies are below;
// Dependencies for the speech client
implementation 'io.grpc:grpc-okhttp:1.27.0'
implementation 'com.google.cloud:google-cloud-speech:1.22.3'
The text was updated successfully, but these errors were encountered: