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

java.lang.NullPointerException #12

Closed
Superhuman07 opened this issue Jun 21, 2016 · 5 comments
Closed

java.lang.NullPointerException #12

Superhuman07 opened this issue Jun 21, 2016 · 5 comments
Assignees
Labels

Comments

@Superhuman07
Copy link

Superhuman07 commented Jun 21, 2016

Hi i am running your app on my device and using my api key it force closes and has this error in the lines:-
FATAL EXCEPTION: main Process: com.akoscz.youtube, PID: 27594 Theme: themes:{} java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.List com.google.api.services.youtube.model.PlaylistListResponse.getItems()' on a null object reference at com.akoscz.youtube.YouTubeRecyclerViewFragment$1.onPostExecute(YouTubeRecyclerViewFragment.java:98) at com.akoscz.youtube.YouTubeRecyclerViewFragment$1.onPostExecute(YouTubeRecyclerViewFragment.java:93) at android.os.AsyncTask.finish(AsyncTask.java:651) at android.os.AsyncTask.-wrap1(AsyncTask.java) at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:668) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5461) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Can you provide solution to this error?

Update :- I learned from one of the issues from your profile that the app needs browser key please update your readme.

@akoscz
Copy link
Owner

akoscz commented Jun 21, 2016

Hi @Superhuman07. Using a Browser key is good for development as a quick solution. But ultimately if you're going to deploy your app to the Google Play Store you should use an Android key built with the SHA1 of your release certificate. See https://developers.google.com/youtube/registering_an_application#android-installed-application-credentials

If you do not publish your app to the Google Play Store, then you should just use a Browser key.

As for the NPE, that's a bug. It should not crash. I will get that fixed in a couple of days when I have some time. Thanks for the report.

@Superhuman07
Copy link
Author

Ok cool! Thanks for the reply.

@akoscz
Copy link
Owner

akoscz commented Jun 21, 2016

Re-opening issue so that I don't forget to fix the NPE :)

@akoscz akoscz reopened this Jun 21, 2016
@akoscz akoscz self-assigned this Jun 21, 2016
@akoscz akoscz added the bug label Jun 21, 2016
@goodlifechris
Copy link

Its nort really working the nullpointer error exists any help

@thoinv
Copy link

thoinv commented Sep 14, 2016

You must use "Browser API key" (Server key) because execute() method is part of java client api and not Android Client API

akoscz added a commit that referenced this issue Mar 5, 2017
- avoid NPE by checking for null that’s returned by
GetPlaylistTitlesAsyncTask if there is an IOExcpetion.
- null indicates that we did not receive a response for our playlist
titles
@akoscz akoscz closed this as completed Mar 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants