Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drive Quickstart NullPointerException

i'm trying to get the Google Drive Quickstart example to run but i'll always get a RuntimeException. This seems to come from the depths of the the API i use.

Does anyone had the same Problems then i and could help me to fix it? Here is my errorcode.

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 the Drive Quickstarttutorial, here is a link

like image 497
Fussel Avatar asked Dec 20 '12 18:12

Fussel


1 Answers

It seems like that the initial resumable upload request is failing, probably because of failed authorization, and that is causing the NullPointerException.

Make sure you are using the latest version of the client library and double check your credentials in the APIs Console, package name and SHA1 fingerprint.

If that still doesn't work, try following the step-by-step video that goes through the setup of the same quickstart application: http://www.youtube.com/watch?v=Ied1CjJ0iP0

like image 83
Claudio Cherubino Avatar answered Oct 04 '22 12:10

Claudio Cherubino