我正试图通过浏览此官方谷歌文档来整合Google+ for Android .按照给出的步骤后:
Package.Name和启用Google+ API Sha1.然后我配置示例应用程序
并附加google-play-services_lib(导入)到它.现在,当我运行应用程序时,它在MainActivity中提供了Exception
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(Plus.API, null) // here the exception (nullPointerException)
.addScope(Plus.SCOPE_PLUS_LOGIN).build();
Run Code Online (Sandbox Code Playgroud)
我在物理设备Android 4.1.2上运行它.
通过谷歌,但没有运气.
logcat的:
05-27 10:23:46.808: D/ActivityThread(11136): setTargetHeapUtilization:0.25
05-27 10:23:46.808: D/ActivityThread(11136): setTargetHeapIdealFree:8388608
05-27 10:23:46.808: D/ActivityThread(11136): setTargetHeapConcurrentStart:2097152
05-27 10:23:47.228: D/AndroidRuntime(11136): Shutting down VM
05-27 10:23:47.228: W/dalvikvm(11136): threadid=1: thread exiting with uncaught exception (group=0x411eb438)
05-27 10:23:47.228: E/AndroidRuntime(11136): FATAL EXCEPTION: main
05-27 10:23:47.228: E/AndroidRuntime(11136): java.lang.RuntimeException: Unable to start activity …