我目前正在尝试从API 23 AVD访问GooglePlayServices。但是,每次我尝试连接时,AVD都会回复说没有互联网连接。
我已经在我的Android Manifest中请求了许可,我相信已经制作了一个有效的GoogleApiClient,所以目前我还不太确定问题是什么。
这是lolcat的结果:
05-08 19:23:48.659 10937-10937/? I/art: Not late-enabling -Xcheck:jni (already on)
05-08 19:23:48.803 10937-10937/com.example.denny.protoype2 W/System: ClassLoader referenced unknown path: /data/app/com.example.denny.protoype2-1/lib/x86_64
05-08 19:23:48.861 10937-10937/com.example.denny.protoype2 I/GMPM: App measurement is starting up, version: 8487
05-08 19:23:48.861 10937-10937/com.example.denny.protoype2 I/GMPM: To enable debug logging run: adb shell setprop log.tag.GMPM VERBOSE
05-08 19:23:48.865 10937-10937/com.example.denny.protoype2 E/GMPM: GoogleService failed to initialize, status: 10, Missing an expected resource: 'R.string.google_app_id' for initializing Google services. Possible causes are missing google-services.json or com.google.gms.google-services gradle plugin.
05-08 19:23:48.865 10937-10937/com.example.denny.protoype2 E/GMPM: Scheduler not set. Not logging error/warn.
05-08 19:23:48.950 10937-10964/com.example.denny.protoype2 E/GMPM: Uploading is not possible. App measurement disabled
05-08 19:23:49.088 10937-10968/com.example.denny.protoype2 D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
05-08 19:23:49.434 10937-10968/com.example.denny.protoype2 I/OpenGLRenderer: Initialized EGL, version 1.4
05-08 19:23:49.606 10937-10968/com.example.denny.protoype2 W/EGL_emulation: eglSurfaceAttrib not implemented
05-08 19:23:49.606 10937-10968/com.example.denny.protoype2 W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7fc8fab766c0, error=EGL_SUCCESS
05-08 19:23:49.687 10937-10937/com.example.denny.protoype2 I/Choreographer: Skipped 31 frames! The application may be doing too much work on its main thread.
05-08 19:25:07.546 10937-10968/com.example.denny.protoype2 W/EGL_emulation: eglSurfaceAttrib not implemented
05-08 19:25:07.546 10937-10968/com.example.denny.protoype2 W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7fc8fcbf0740, error=EGL_SUCCESS
05-08 19:25:07.983 10937-10968/com.example.denny.protoype2 E/Surface: getSlotFromBufferLocked: unknown buffer: 0x7fc8fed394d0
05-08 19:25:07.991 10937-10968/com.example.denny.protoype2 D/OpenGLRenderer: endAllStagingAnimators on 0x7fc8feeb2c00 (RippleDrawable) with handle 0x7fc8fed0ba60
05-08 19:25:09.149 10937-12092/com.example.denny.protoype2 I/GMPM: Tag Manager is not found and thus will not be used
05-08 19:25:10.042 10937-10937/com.example.denny.protoype2 W/ViewRootImpl: Cancelling event due to no window focus: MotionEvent { action=ACTION_CANCEL, actionButton=0, id[0]=0, x[0]=575.4968, y[0]=537.2461, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=818623, downTime=815709, deviceId=0, source=0x1002 }
05-08 19:25:10.042 10937-10937/com.example.denny.protoype2 W/ViewRootImpl: Cancelling event due to no window focus: MotionEvent { action=ACTION_CANCEL, actionButton=0, id[0]=0, x[0]=575.4968, y[0]=537.2461, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=818623, downTime=815709, deviceId=0, source=0x1002 }
05-08 19:25:10.042 10937-10937/com.example.denny.protoype2 W/ViewRootImpl: Cancelling event due to no window focus: MotionEvent { action=ACTION_CANCEL, actionButton=0, id[0]=0, x[0]=575.4968, y[0]=537.2461, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=818623, downTime=815709, deviceId=0, source=0x1002 }
05-08 19:25:10.042 10937-10937/com.example.denny.protoype2 W/ViewRootImpl: Cancelling event due to no window focus: MotionEvent { action=ACTION_CANCEL, actionButton=0, id[0]=0, x[0]=575.4968, y[0]=537.2461, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=818623, downTime=815709, deviceId=0, source=0x1002 }
05-08 19:25:10.990 10937-10937/com.example.denny.protoype2 W/GmsSupportLifecycleFrag: Unresolved error while connecting client. Stopping auto-manage.
05-08 19:25:11.114 10937-10968/com.example.denny.protoype2 W/EGL_emulation: eglSurfaceAttrib not implemented
05-08 19:25:11.114 10937-10968/com.example.denny.protoype2 W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7fc8fab76680, error=EGL_SUCCESS
05-08 19:25:15.145 10937-10968/com.example.denny.protoype2 E/Surface: getSlotFromBufferLocked: unknown buffer: 0x7fc8f104e1f0
这是onCreate()的相关课程:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_viewing_window);
mRequestingLocationUpdates = ((Protoype2)getApplication()).getRequestingLocationUpdates();
if (mRequestingLocationUpdates) {
StoppedMessage();
}
ExceedInstance = 0;
mGoogleApiClient = new GoogleApiClient.Builder(this)
.enableAutoManage(this, this)
.addApi(Drive.API)
.addScope(Drive.SCOPE_FILE)
.build();
String[] LocationPermission = new String[]{Manifest.permission.ACCESS_FINE_LOCATION};
if (ContextCompat.checkSelfPermission(ViewingWindow.this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
if (ActivityCompat.shouldShowRequestPermissionRationale(ViewingWindow.this,
Manifest.permission.ACCESS_FINE_LOCATION)) {
GPSExplanation();
} else {
ActivityCompat.requestPermissions(ViewingWindow.this,
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);
}
}
onRequestPermissionsResult(MY_PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION, LocationPermission, grantResults);
final Button BackButton = (Button)findViewById(R.id.VWBackButton);
BackButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent GoBackIntent = new Intent (ViewingWindow.this, MainActivity.class);
startActivity(GoBackIntent);
}
});
updateValuesFromBundle(savedInstanceState);
}