-
Notifications
You must be signed in to change notification settings - Fork 703
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
Initializing MyApi using builder giver Exception #1450
Comments
Hey there, if you'd like this to work in the interim I've answered an SO post about the problem here: https://stackoverflow.com/questions/59243821/youtube-api-exception-in-initializer-error/59298544#59298544 And unfortunately, I duplicated this issue here if someone would like to decide which issue to close: #1451 Cheers |
This should be fixed in 1.30.7. |
Still getting this error on
Code where it occurs..
|
To be clear, it didn't whether minifyEnabled was true or false, right? I'm not an Android expert so I need to dig into what minifyEnabled implies, but I'm guessing that it's somehow stripping code and removing code that is in fact accessed by reflection. |
Bingo: For most situations, the default ProGuard rules file (proguard-android- optimize.txt) is sufficient for R8 to remove only the unused code. However, some situations are difficult for R8 to analyze correctly and it might remove code your app actually needs. Some examples of when it might incorrectly remove code include:
Testing your app should reveal any errors caused by inappropriately removed code, but you can also inspect what code was removed by generating a report of removed code. To fix errors and force R8 to keep certain code, add a -keep line in the ProGuard rules file. For example: -keep public class MyClass Alternatively, you can add the @keep annotation to the code you want to keep. Adding @keep on a class keeps the entire class as-is. Adding it on a method or field will keep the method/field (and its name) as well as the class name intact. Note that this annotation is available only when using the AndroidX Annotations Library and when you include the ProGuard rules file that is packaged with the Android Gradle plugin, as described in the section about how to enable shrinking. There are many considerations you should make when using the -keep option; for more information about customizing your rules file, read the ProGuard Manual. The Troubleshooting section outlines other common problems you might encounter when your code gets stripped away. |
The problem is from https://github.com/googleapis/google-api-java-client/pull/1452/files and I think this line in
|
We should probably apply the annotation |
Meanwhile try adding -keep public class com.google.api.client.googleapis.GoogleUtils or some such thing to your proguard rules file. |
Caused by: java.lang.IllegalStateException: No successful match so far
at java.util.regex.Matcher.ensureMatch(Matcher.java:1116)
at java.util.regex.Matcher.group(Matcher.java:382)
at com.google.api.client.googleapis.GoogleUtils.(GoogleUtils.java:66)
at com.idragonit.backend.myApi.MyApi.(MyApi.java:46)
Version Using: implementation 'com.google.api-client:google-api-client:1.30.6'
in my andoid backed library
In GoogleUtils.java line number 64
Matcher versionMatcher = VERSION_PATTERN.matcher(VERSION);
I am getting VERSION string 0.0
The text was updated successfully, but these errors were encountered: