title: Error: GooglePlayServicesUtil﹕ Internal error occurred. Please see logs for detailed information. How do I fix this?
body: <p>I have spent countless hours trying to figure out this google drive android api, and I have frustrated myself to the core trying to figure out how exactly to use it. I am using the <a href="https://developers.google.com/drive/android/get-started">getting started link</a> on the google android developers website, and this is what I've done:</p>
  
  <pre><code>package viva.inspection.com.inspectionpicker;
  
  import android.app.Activity;
  import android.content.Context;
  import android.content.Intent;
  import android.content.IntentSender;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.view.View;
  import android.widget.AdapterView;
  import android.widget.ArrayAdapter;
  import android.widget.Button;
  import android.widget.Spinner;
  
  import com.google.android.gms.common.ConnectionResult;
  import com.google.android.gms.common.GooglePlayServicesUtil;
  import com.google.android.gms.common.api.GoogleApiClient;
  import com.google.android.gms.drive.Drive;
  import com.google.android.gms.common.api.ResultCallback;
  import com.google.android.gms.drive.Drive;
  import com.google.android.gms.drive.DriveApi.ContentsResult;
  import com.google.android.gms.drive.DriveId;
  import com.google.android.gms.drive.MetadataChangeSet;
  import com.google.android.gms.drive.OpenFileActivityBuilder;
  import com.google.android.gms.common.api.ResultCallback;
  import com.google.android.gms.drive.Drive;
  import com.google.android.gms.drive.DriveApi.ContentsResult;
  import com.google.android.gms.drive.DriveId;
  import com.google.android.gms.drive.MetadataChangeSet;
  import com.google.android.gms.drive.OpenFileActivityBuilder;
  
  import java.lang.reflect.Array;
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.List;
  import java.util.logging.Logger;
  
  import viva.inspection.com.inspectionpicker.MultiSpinner;
  
  
  public class MyActivity extends Activity implements MultiSpinner.MultiSpinnerListener, AdapterView.OnItemSelectedListener, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener {
      GoogleApiClient mGoogleApiClient;
      final private static int RESOLVE_CONNECTION_REQUEST_CODE = 1;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_my);
          Button save = (Button) findViewById(R.id.save);
          //array for the tasks multi-spinner
          String[] array = getResources().getStringArray(R.array.rooms_array);
          List&lt;String&gt; rooms = new ArrayList&lt;String&gt;(Arrays.asList(array));
          // Create an ArrayAdapter using the string array and a default spinner layout
          final Spinner roomSpinner = (Spinner) findViewById(R.id.rooms);
          Spinner itemsSpinner = (Spinner) findViewById(R.id.inspectionItems);
          ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource(this,
                  R.array.rooms_array, android.R.layout.simple_spinner_item);
          // Specify the layout to use when the list of choices appears
          adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
          // Apply the adapter to the spinner
          roomSpinner.setAdapter(
                  new NothingSelectedSpinnerAdapter(
                          adapter,
                          R.layout.contact_spinner_row_nothing_selected,
                          // R.layout.contact_spinner_nothing_selected_dropdown, // Optional
                          this));
          roomSpinner.setOnItemSelectedListener(this);
          itemsSpinner.setOnItemSelectedListener(this);
          final MultiSpinner multiSpinner = (MultiSpinner) findViewById(R.id.multi_spinner);
          multiSpinner.setItems(rooms, "(Choose One)", this);
          mGoogleApiClient = new GoogleApiClient.Builder(this)
                  .addApi(Drive.API)
                  .addScope(Drive.SCOPE_FILE)
                  .addConnectionCallbacks(this)
                  .addOnConnectionFailedListener(this)
                  .build();
          save.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  Intent intent = new Intent(MyActivity.this, ListActivity.class);
                  intent.putExtra("NEW_VALUE", roomSpinner.getSelectedItem().toString());
                  startActivity(intent);
              }
          });
      }
  
      ...
  
      @Override
      protected void onStart() {
          super.onStart();
          mGoogleApiClient.connect();
      }
  
      @Override
      public void onConnectionFailed(ConnectionResult connectionResult) {
          if (connectionResult.hasResolution()) {
              try {
                  connectionResult.startResolutionForResult(this, RESOLVE_CONNECTION_REQUEST_CODE);
              } catch (IntentSender.SendIntentException e) {
                  // Unable to resolve, message user appropriately
              }
          } else {
              GooglePlayServicesUtil.getErrorDialog(connectionResult.getErrorCode(), this, 0).show();
          }
      }
  
      ...
  
      @Override
      public void onConnected(Bundle bundle) {
          Drive.DriveApi.newContents(mGoogleApiClient)
                  .setResultCallback(contentsCallback);
      }
  
      @Override
      public void onConnectionSuspended(int i) {
  
      }
  
      @Override
      protected void onActivityResult(final int requestCode, final int resultCode, final Intent data) {
          switch (requestCode) {
              case RESOLVE_CONNECTION_REQUEST_CODE:
                  if (resultCode == RESULT_OK) {
                      mGoogleApiClient.connect();
                      DriveId driveId = (DriveId) data.getParcelableExtra(
                              OpenFileActivityBuilder.EXTRA_RESPONSE_DRIVE_ID);
                  }
                  break;
          }
      }
  
      ResultCallback&lt;ContentsResult&gt; contentsCallback = new
              ResultCallback&lt;ContentsResult&gt;() {
                  @Override
                  public void onResult(ContentsResult result) {
                      if (!result.getStatus().isSuccess()) {
                          // Handle error
                          return;
                      }
  
                      MetadataChangeSet metadataChangeSet = new MetadataChangeSet.Builder()
                              .setMimeType("text/html").build();
                      IntentSender intentSender = Drive.DriveApi
                              .newCreateFileActivityBuilder()
                              .setInitialMetadata(metadataChangeSet)
                              .setInitialContents(result.getContents())
                              .build(mGoogleApiClient);
                      try {
                          startIntentSenderForResult(intentSender, 1, null, 0, 0, 0);
                      } catch (IntentSender.SendIntentException e) {
                          // Handle the exception
                      }
                  }
              };
  }
  </code></pre>
  
  <p>This is my manifest, and I have no idea how the manifest should look like:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="viva.inspection.com.inspectionpicker"&gt;
      &lt;uses-permission android:name="android.permission.GET_ACCOUNTS" /&gt;
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme"&gt;
          &lt;meta-data android:name="com.google.android.gms.version"
              android:value="@integer/google_play_services_version" /&gt;
  
          &lt;activity
              android:name=".ListActivity"
              android:label="@string/app_name"
              android:screenOrientation="portrait" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity
              android:name=".MyActivity"
              android:label="MyActivity"
              android:exported="true"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.google.android.apps.drive.DRIVE_OPEN" /&gt;
                  &lt;data android:mimeType="application/vnd.google-apps.drive-sdk.1234567890" /&gt;
                  &lt;data android:mimeType="image/png" /&gt;
                  &lt;data android:mimeType="image/jpeg" /&gt;
                  &lt;data android:mimeType="image/jpg" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity
              android:name=".InitialChoose"
              android:label="@string/title_activity_initial_choose"
              android:windowSoftInputMode="stateHidden"&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>When I run the app, a dialog box appears that states "Unknown issue with Google Play services", and then in log cat this appears:</p>
  
  <pre><code>Error: GooglePlayServicesUtil﹕ Internal error occurred. Please see logs for detailed information. 
  </code></pre>
  
  <p>But there's nothing in the logs, so again I'm completely confused. I have looked at other questions, and I have indeed set up my app with the developer console, as per the instructions in the getting started link above.</p>
  
  <p>I really need help. </p>
  
  <p>Thanks in advance.</p>