小编Kir*_* A.的帖子

java.lang.NoClassDefFoundError:com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential

我正在尝试在我的Android Applciation中实施Google Drive,并且收到 java.lang.NoClassDefFoundError: com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential 错误,所以任何知道如何解决此问题的人.

我现在还试过

  • 成功导入Google云端硬盘所需的所有.jar
  • 导入Google Play服务库.在我的项目中成功
  • 试图重新启动eclipse并检查但是同样的错误即将到来
  • 从谷歌Drive API或Android的Play服务获得API密钥和客户端ID
  • 已经在这里访问了一些解决方案

这里一样尝试

这是我的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)

android google-drive-api

7
推荐指数
1
解决办法
4464
查看次数

java.lang.ClassCastException:android.support.v4.app.NoSaveStateFrameLayout无法强制转换为com.google.android.maps.MapView

这是我的活动代码

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

3
推荐指数
1
解决办法
4854
查看次数