我正在尝试在我的Android Applciation中实施Google Drive,并且收到 java.lang.NoClassDefFoundError: com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential
错误,所以任何知道如何解决此问题的人.
我现在还试过
和这里一样尝试
这是我的Logcat-
03-21 15:03:55.194: E/AndroidRuntime(940): FATAL EXCEPTION: main
03-21 15:03:55.194: E/AndroidRuntime(940): java.lang.NoClassDefFoundError: com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential
03-21 15:03:55.194: E/AndroidRuntime(940): at com.example.alltaskass.GoogleDrive.onCreate(GoogleDrive.java:53)
03-21 15:03:55.194: E/AndroidRuntime(940): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
03-21 15:03:55.194: E/AndroidRuntime(940): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1700)
03-21 15:03:55.194: E/AndroidRuntime(940): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1752)
03-21 15:03:55.194: E/AndroidRuntime(940): at android.app.ActivityThread.access$1500(ActivityThread.java:123)
03-21 15:03:55.194: E/AndroidRuntime(940): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:993)
03-21 15:03:55.194: E/AndroidRuntime(940): at android.os.Handler.dispatchMessage(Handler.java:99)
03-21 15:03:55.194: E/AndroidRuntime(940): at android.os.Looper.loop(Looper.java:126)
03-21 15:03:55.194: E/AndroidRuntime(940): at android.app.ActivityThread.main(ActivityThread.java:3997)
03-21 15:03:55.194: E/AndroidRuntime(940): at …Run Code Online (Sandbox Code Playgroud) 这是我的活动代码
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.map);
GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext());
mapView = (MapView) findViewById(R.id.map);
GoogleMap map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))
.getMap();
}
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.id.map, container, false);
}
Run Code Online (Sandbox Code Playgroud)
这是我的LogCat
03-22 11:53:38.497: E/AndroidRuntime(436): FATAL EXCEPTION: main
03-22 11:53:38.497: E/AndroidRuntime(436): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.alltaskass/com.example.alltaskass.Map}: java.lang.ClassCastException: android.support.v4.app.NoSaveStateFrameLayout cannot be cast to com.google.android.maps.MapView
03-22 11:53:38.497: E/AndroidRuntime(436): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1736)
03-22 11:53:38.497: E/AndroidRuntime(436): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1752)
03-22 11:53:38.497: E/AndroidRuntime(436): at android.app.ActivityThread.access$1500(ActivityThread.java:123)
03-22 11:53:38.497: E/AndroidRuntime(436): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:993)
03-22 11:53:38.497: E/AndroidRuntime(436): …Run Code Online (Sandbox Code Playgroud) android google-maps google-maps-api-2 google-maps-android-api-2