Title: Build failed with exception for task ':run' · Issue #3 · serpapi/serpapi-java · GitHub
Open Graph Title: Build failed with exception for task ':run' · Issue #3 · serpapi/serpapi-java
X Title: Build failed with exception for task ':run' · Issue #3 · serpapi/serpapi-java
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 a...
Open Graph 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 ...
X 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.jav...
Opengraph URL: https://github.com/serpapi/serpapi-java/issues/3
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Build failed with exception for task ':run'","articleBody":"Currently, running the code sample shows this error\r\n\r\n```\r\n\u003e Task :run\r\nfind the first Coffee in Austin,Texas\r\nException in thread \"main\" java.lang.NullPointerException\r\n\tat demo.App.main(App.java:43)\r\n\r\n\u003e Task :run FAILED\r\n\r\nFAILURE: Build failed with an exception.\r\n\r\n* What went wrong:\r\nExecution failed for task ':run'.\r\n\u003e Process 'command '/Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java'' finished with non-zero exit value 1\r\n```\r\n\r\nThe 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.\r\n\r\nHere is my update suggestion for the code sample and readme instruction:\r\n```\r\n JsonArray results = data.get(\"organic_results\").getAsJsonArray(); \r\nJsonObject first_result = results.get(0).getAsJsonObject();\r\nSystem.out.println(first_result);\r\n```","author":{"url":"https://github.com/hilmanski","@type":"Person","name":"hilmanski"},"datePublished":"2024-05-28T03:23:09.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/3/serpapi-java/issues/3"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d6295bed-b3a3-06b2-3480-de7b38c0e5fa |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CA8A:1683D8:12C0A1A:1871244:698FC959 |
| html-safe-nonce | a20026a51194651605dea7cbe82d04fd23b3e65b7188046fa07ad8df8e750335 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQThBOjE2ODNEODoxMkMwQTFBOjE4NzEyNDQ6Njk4RkM5NTkiLCJ2aXNpdG9yX2lkIjoiMTYzOTQzNTcxNzgzMzY0MDI4MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 25fb39e1a959ec2c5c677872616d1f57aef9c967ee50c1676f428f996044879a |
| hovercard-subject-tag | issue:2320045975 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/serpapi/serpapi-java/3/issue_layout |
| twitter:image | https://opengraph.githubassets.com/179eb5a4ecb78cece694a74e5c7bb2d03745254cefa6e93cce13aee9352e298b/serpapi/serpapi-java/issues/3 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/179eb5a4ecb78cece694a74e5c7bb2d03745254cefa6e93cce13aee9352e298b/serpapi/serpapi-java/issues/3 |
| og:image:alt | 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 ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hilmanski |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/serpapi/serpapi-java git https://github.com/serpapi/serpapi-java.git |
| octolytics-dimension-user_id | 34724717 |
| octolytics-dimension-user_login | serpapi |
| octolytics-dimension-repository_id | 736429437 |
| octolytics-dimension-repository_nwo | serpapi/serpapi-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 736429437 |
| octolytics-dimension-repository_network_root_nwo | serpapi/serpapi-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 00bbb8945a3943b287e04c68aff13cb5878ddde7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width