Quickstart NullPointerException Drive

I try to run the Quickstart example on Google Drive, but always get a RuntimeException. This seems to come from the depth of the API used.

Has anyone had the same problems as me and could help me fix this? Here is my error code.

12-20 19:19:54.920: E/AndroidRuntime(15682): FATAL EXCEPTION: Thread-2016 12-20 19:19:54.920: E/AndroidRuntime(15682): java.lang.NullPointerException 12-20 19:19:54.920: E/AndroidRuntime(15682): at java.net.URI.parseURI(URI.java:353) 12-20 19:19:54.920: E/AndroidRuntime(15682): at java.net.URI.<init>(URI.java:204) 12-20 19:19:54.920: E/AndroidRuntime(15682): at com.google.api.client.http.GenericUrl.<init>(GenericUrl.java:100) 12-20 19:19:54.920: E/AndroidRuntime(15682): at com.google.api.client.googleapis.media.MediaHttpUploader.upload(MediaHttpUploader.java:269) 12-20 19:19:54.920: E/AndroidRuntime(15682): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:408) 12-20 19:19:54.920: E/AndroidRuntime(15682): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:328) 12-20 19:19:54.920: E/AndroidRuntime(15682): at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:449) 12-20 19:19:54.920: E/AndroidRuntime(15682): at com.example.drivequickstart.MainActivity$1.run(MainActivity.java:97) 12-20 19:19:54.920: E/AndroidRuntime(15682): at java.lang.Thread.run(Thread.java:856) 12-20 19:19:55.100: D/OpenGLRenderer(15682): Flushing caches (mode 0) 12-20 19:19:55.130: D/OpenGLRenderer(15682): Flushing caches (mode 1) 12-20 19:20:19.750: I/Process(15682): Sending signal. PID: 15682 SIG: 9 

I copied the code from Quickstarttutorial in Drive, here is the link

+6
source share
1 answer

It seems that the initial renewed download request does not work, probably due to failed authorization, and this throws a NullPointerException.

Make sure you use the latest client library and double-check your credentials in the API console, package name, and SHA1 fingerprint.

If this still does not work, try a step-by-step video that goes through the setup of the same quick launch application: http://www.youtube.com/watch?v=Ied1CjJ0iP0

+1
source

All Articles