-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Currently, running the code sample shows this error
> Task :run
find the first Coffee in Austin,Texas
Exception in thread "main" java.lang.NullPointerException
at demo.App.main(App.java:43)
> Task :run FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':run'.
> Process 'command '/Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java'' finished with non-zero exit value 1
The error wasn't clear at first, but I noticed from the default sample, we should replace local_results with more generic results since local_results is not always available on the response.
Here is my update suggestion for the code sample and readme instruction:
JsonArray results = data.get("organic_results").getAsJsonArray();
JsonObject first_result = results.get(0).getAsJsonObject();
System.out.println(first_result);
Metadata
Metadata
Assignees
Labels
No labels