【问题标题】:Error:Conversion to Dalvik format failed with error 1 during Google+ integration错误:在 Google+ 集成期间转换为 Dalvik 格式失败,错误 1
【发布时间】:2016-01-26 21:49:21
【问题描述】:

我想通过引用site 将Google Plus 集成到Eclipse4.4.1 的android 应用程序中。但面临非常令人沮丧的错误

转换为 Dalvik 格式失败,出现错误 1

在控制台中

GooglePlus] Dx 未捕获的翻译错误: java.util.concurrent.ExecutionException:java.lang.OutOfMemoryError: Java 堆空间 GooglePlus] Dx 未捕获的翻译错误:java.util.concurrent.ExecutionException:java.lang.OutOfMemoryError: Java 堆空间 GooglePlus] Dx 2 错误;中止 GooglePlus] 转换为 Dalvik 格式失败,出现错误 1

当我在我们的项目中添加 google-play-services_lib 作为库时

和库

MainActivity.java

private GoogleApiClient mGoogleApiClient;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    mGoogleApiClient = new GoogleApiClient.Builder(this)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this).addApi(Plus.API)
            .addScope(new Scope(Scopes.PROFILE)).addScope(new Scope(Scopes.EMAIL)).build();
}

我在 stackoverflow 中尝试了很多勾号(如清理项目、重建),但没有运气。

请指导我。

【问题讨论】:

  • 跳转到Android Studio
  • 显示你在构建路径中添加的jar文件
  • 删除不必要的 jar 并取消选中自动构建。清理您的项目并自动检查构建。然后尝试运行您的项目。
  • @MD 但先生,请为日食打勾......
  • @Materazzi06 我试过了,但没用....

标签: android eclipse google-plus google-play-services


【解决方案1】:

经过多次打勾和搜索,我得到了它的解决方案,希望未来的访问者对我有用。
第 1 步: 转到 eclipse 设置文件夹并找到 eclipse(配置设置文件)命名文件。
第 2 步: 编辑此文件,如下所示:
你可以替换

-Xms40m
-Xmx512m

-Xms40m
-Xmx1024m


第 3 步:保存并重新启动您的 Eclipse。
这对我来说很好,希望对其他人也一样。
谢谢

【讨论】:

    猜你喜欢
    • 2011-06-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-07
    • 1970-01-01
    相关资源
    最近更新 更多