【问题标题】:Cannot build app containing both Azure SDK and Google Play无法构建同时包含 Azure SDK 和 Google Play 的应用
【发布时间】:2015-10-19 21:06:28
【问题描述】:

我很清楚Android中app:dexDebug错误背后的原因。在stackoverflow中经历了许多类似的问题并尝试了所有可能的解决方案,我终于找到了错误的原因。下面是我的依赖:

如果两者都编译

compile 'com.google.android.gms:play-services:+'
compile 'com.microsoft.azure:azure-mobile-services-android-sdk:2.0.3'

都是一起编译的,是错误造成的。删除任何一个编译都会删除错误,但我不明白为什么?云消息传递需要 Google Play,而将设备注册到 Azure 推送通知中心则需要 Azure 服务。我看不出他们共享通用 jar 文件或在任何地方重复/重复类的任何可能性。

libs 文件夹为空。

对这个问题有什么建议吗?

【问题讨论】:

  • 如果您希望人们帮助您理解错误,发布错误消息的实际文本会有所帮助 - 否则,我们只是在猜测。
  • 错误:任务 ':app:dexDebug' 执行失败。 > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_40\bin\java.exe'' 没有完成-zero exit value 2 ---- 这是我收到的错误信息

标签: java android azure google-cloud-messaging


【解决方案1】:

Google play 服务和 azure 移动服务编译不冲突。我有一个带有依赖项的测试项目: compile 'com.android.support:appcompat-v7:23.1.0' compile 'com.microsoft.azure:azure-mobile-services-android-sdk:2.0.3' compile 'com.google.android.gms:play-services:+' 并将项目与 gradle 文件同步,它在我这边运行良好。

要在 Azure 移动服务中集成通知中心,我们可以参考 official guide of Azure Notification Hubs,它于 2015 年 10 月 15 日更新。在本文中,它使用了gms 依赖: compile 'com.google.android.gms:play-services-base:6.5.87'

对了,我找到了thread with the same issue you met,也许它会给你一些帮助。

【讨论】:

  • 伴侣,这正是需要的东西。虽然迟到了谢谢你的回复。我只是从 azure 下载了“创建新应用程序”,然后将应用程序 gradle 中的依赖项复制到我自己的项目中,它就可以工作了 :) 可能这对某些人也有帮助。
【解决方案2】:

您不应该使用版本号而不是“+”吗?

试试这个:

compile 'com.google.android.gms:play-services:8.1.0'

因为可能是 '+' 正在编译 2 个导入....

编辑:您的错误跟踪到底是什么?

【讨论】:

  • 我试过了,但仍然报同样的错误。此外,在我的 manifest.xml 中,我有 这应该会自动给出正确的播放版本服务。
  • 在每个 app:dexDebug 问题中,我在 gradle biuild 之后出现Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_40\bin\java.exe'' finished with non-zero exit value 2 错误
【解决方案3】:

好吧,实际上 play service 和 azure service 二进制文件都有依赖循环。要解决此问题,而不是使用通用语句(即 'com.google.android.gms:play-services:8.3.0' )使用精确的语句(即例如 'com.google.android.gms:play-services- maps:8.3.0' ) 缩小了编译区域,从而减少了冲突的可能性。希望这会有所帮助

【讨论】:

    猜你喜欢
    • 2016-07-29
    • 2020-02-29
    • 2016-05-21
    • 2016-02-01
    • 2015-01-07
    • 2020-08-28
    • 2016-02-20
    • 2014-06-18
    • 1970-01-01
    相关资源
    最近更新 更多