首页 文章

NoClassDefFoundError:com.google.android.gms.common.GooglePlayServicesUtil

提问于
浏览
0

我试图使用google-play-services_lib将admob Banner 添加到我的android项目中 . 我使用eclipse,我已经按照https://developer.android.com/google/play-services/setup.html来设置库项目,没有看到probs . 我在我的android项目中添加它作为参考 . 建设很好 . 但是当我在设备上运行它时,我得到:

NoClassDefFoundError:com.google.android.gms.common.GooglePlayServicesUtil

以下是我项目的onCreate()方法的摘录:

int statusCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
if( statusCode != ConnectionResult.SUCCESS)
{
    Log.e("statuscode",statusCode+"");
}
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice("my_device_id")
.build();

此外,如果我删除isGooglePlayServicesAvailable()检查并直接转到AdRequest.Builder(),我现在为AdRequest $ Builder获得相同的NoClassFoundDefError

1 回答

  • 0

    很明显,你没有在你的APK中包含付费服务库 . 从一开始就再次执行Eclipse的步骤 .

相关问题