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

Unable to create instance of class com.google.maps.GeocodingApi$Response. Registering an InstanceCreator or a TypeAdapter for this type, or adding a no-args constructor may fix this problem. #914

Open
joaorodrigo opened this issue Jun 28, 2023 · 3 comments
Assignees
Labels
triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@joaorodrigo
Copy link

Hello, I have a problem running my Java Spring Boot application with a native image.

When searching for an address I get the error:
Unable to create instance of class com.google.maps.GeocodingApi$Response. Registering an InstanceCreator or a TypeAdapter for this type, or adding a no-args constructor may fix this problem.

The error only occurs when compiling with native image, when using JVM the problem does not occur.

Spring Boot: 3.0.6
GraalVM: 22.3.1
JDK: 17

@joaorodrigo joaorodrigo added triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Jun 28, 2023
@wangela
Copy link
Member

wangela commented Jun 28, 2023

If you would like to upvote the priority of this issue, please comment below or react with 👍 so we can see what is popular when we triage.

@joaorodrigo Thank you for opening this issue. 🙏
Please check out these other resources that might help you get to a resolution in the meantime:

This is an automated message, feel free to ignore.

@locagen
Copy link

locagen commented Aug 3, 2023

Having the same issue with NearbySearchRequest:
Unable to create instance of class com.google.maps.NearbySearchRequest$Response. Registering an InstanceCreator or a TypeAdapter for this type, or adding a no-args constructor may fix this problem.

@castelloms
Copy link

castelloms commented Oct 27, 2023

There is a similar behaviour while using TimeZoneApi with Quarkus native images, we need to add annotation RegisterForReflection, but the inner Reponse class is not public, so not able to make it work. Changing the inner class Response to public will solve the issue.

threw an exception: java.lang.RuntimeException: Unable to create instance of class com.google.maps.TimeZoneApi$Response. Registering an InstanceCreator or a TypeAdapter for this type, or adding a no-args constructor may fix this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

5 participants