After I run the code on my Phone, I always get a "Unknown issue with Google Play Services" dialog. (It goes into the onConnectionFailed method) could someone help resolve this? I don't know how to debug this further!
This is my code:
package com.example.ashwinpraveen1.googleapi;
import android.content.IntentSender;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
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;
public class MainActivity extends ActionBarActivity implements GoogleApiClient.OnConnectionFailedListener,GoogleApiClient.ConnectionCallbacks{
TextView checking;
GoogleApiClient mGoogleApiClient;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
GDriveLogin();
}
@Override
public void onConnected(Bundle connectionHint) {
checking = (TextView) findViewById(R.id.checking);
checking.setText("working");
}
void GDriveLogin(){
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addApi(Drive.API)
.addScope(Drive.SCOPE_FILE)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
}
@Override
public void onConnectionFailed(ConnectionResult connectionResult) {
checking = (TextView) findViewById(R.id.checking);
checking.setText("Not working");
if (connectionResult.hasResolution()) {
try {
connectionResult.startResolutionForResult(this, 0);
} catch (IntentSender.SendIntentException e) {
// Unable to resolve, message user appropriately
}
} else {
GooglePlayServicesUtil.getErrorDialog(connectionResult.getErrorCode(), this, 0).show();
}
}
@Override
public void onConnectionSuspended(int i) {
}
@Override
protected void onStart() {
super.onStart();
mGoogleApiClient.connect();
}
}
This is what the log shows:
02-24 14:50:03.217 17329-17329/com.example.ashwinpraveen1.googleapi I/dalvikvm﹕ Could not find method android.view.ViewGroup.onNestedScrollAccepted, referenced from method android.support.v7.internal.widget.ActionBarOverlayLayout.onNestedScrollAccepted
02-24 14:50:03.217 17329-17329/com.example.ashwinpraveen1.googleapi W/dalvikvm﹕ VFY: unable to resolve virtual method 11804: Landroid/view/ViewGroup;.onNestedScrollAccepted (Landroid/view/View;Landroid/view/View;I)V
02-24 14:50:03.217 17329-17329/com.example.ashwinpraveen1.googleapi D/dalvikvm﹕ VFY: replacing opcode 0x6f at 0x0000
02-24 14:50:03.217 17329-17329/com.example.ashwinpraveen1.googleapi I/dalvikvm﹕ Could not find method android.view.ViewGroup.onStopNestedScroll, referenced from method android.support.v7.internal.widget.ActionBarOverlayLayout.onStopNestedScroll
02-24 14:50:03.217 17329-17329/com.example.ashwinpraveen1.googleapi W/dalvikvm﹕ VFY: unable to resolve virtual method 11810: Landroid/view/ViewGroup;.onStopNestedScroll (Landroid/view/View;)V
02-24 14:50:03.217 17329-17329/com.example.ashwinpraveen1.googleapi D/dalvikvm﹕ VFY: replacing opcode 0x6f at 0x0000
02-24 14:50:03.217 17329-17329/com.example.ashwinpraveen1.googleapi I/dalvikvm﹕ Could not find method android.support.v7.internal.widget.ActionBarOverlayLayout.stopNestedScroll, referenced from method android.support.v7.internal.widget.ActionBarOverlayLayout.setHideOnContentScrollEnabled
02-24 14:50:03.217 17329-17329/com.example.ashwinpraveen1.googleapi W/dalvikvm﹕ VFY: unable to resolve virtual method 9455: Landroid/support/v7/internal/widget/ActionBarOverlayLayout;.stopNestedScroll ()V
02-24 14:50:03.217 17329-17329/com.example.ashwinpraveen1.googleapi D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x000e
02-24 14:50:03.227 17329-17329/com.example.ashwinpraveen1.googleapi I/dalvikvm﹕ Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.internal.widget.TintTypedArray.getChangingConfigurations
02-24 14:50:03.227 17329-17329/com.example.ashwinpraveen1.googleapi W/dalvikvm﹕ VFY: unable to resolve virtual method 540: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
02-24 14:50:03.227 17329-17329/com.example.ashwinpraveen1.googleapi D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
02-24 14:50:03.227 17329-17329/com.example.ashwinpraveen1.googleapi I/dalvikvm﹕ Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.internal.widget.TintTypedArray.getType
02-24 14:50:03.227 17329-17329/com.example.ashwinpraveen1.googleapi W/dalvikvm﹕ VFY: unable to resolve virtual method 562: Landroid/content/res/TypedArray;.getType (I)I
02-24 14:50:03.227 17329-17329/com.example.ashwinpraveen1.googleapi D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
02-24 14:50:03.327 17329-17329/com.example.ashwinpraveen1.googleapi D/libEGL﹕ loaded /vendor/lib/egl/libEGL_adreno.so
02-24 14:50:03.327 17329-17329/com.example.ashwinpraveen1.googleapi D/libEGL﹕ loaded /vendor/lib/egl/libGLESv1_CM_adreno.so
02-24 14:50:03.337 17329-17329/com.example.ashwinpraveen1.googleapi D/libEGL﹕ loaded /vendor/lib/egl/libGLESv2_adreno.so
02-24 14:50:03.347 17329-17329/com.example.ashwinpraveen1.googleapi I/Adreno-EGL﹕ <qeglDrvAPI_eglInitialize:381>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LNX.LA.3.2.1.5.04.03.00.191.009_msm8610_LNX.LA.3.2.1.5__release_AU ()
OpenGL ES Shader Compiler Version: 20.00.05
Build Date: 06/10/14 Tue
Local Branch: mybranch3525181
Remote Branch: quic/LNX.LA.3.2.1.5
Local Patches: NONE
Reconstruct Branch: AU_LINUX_ANDROID_LNX.LA.3.2.1.5.04.03.00.191.009 + NOTHING
02-24 14:50:03.377 17329-17329/com.example.ashwinpraveen1.googleapi D/OpenGLRenderer﹕ Enabling debug mode 0
02-24 14:50:03.897 17329-17329/com.example.ashwinpraveen1.googleapi E/GooglePlayServicesUtil﹕ Internal error occurred. Please see logs for detailed information
02-24 14:51:22.487 17329-17329/com.example.ashwinpraveen1.googleapi E/GooglePlayServicesUtil﹕ Internal error occurred. Please see logs for detailed information