2016-04-13 103 views
2

我正在嘗試將Facebook集成到我的AOS應用程序中,並且出現此錯誤,我無法弄清楚如何解決此問題。使用Facebook SDK編譯應用程序時出錯

Error:Execution failed for task ':app:transformClassesWithDexForDebug'. com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2

我修改了我的app | gradle這個文件描述here

UPDATE 播放業務在此應用程序

compile 'com.google.android.gms:play-services:8.4.0' compile 'com.google.android.gms:play-services-ads:8.4.0' compile 'com.google.android.gms:play-services-identity:8.4.0' compile 'com.google.android.gms:play-services-gcm:8.4.0'

任何想法用嗎? 謝謝,

+0

你用過gradle中的play服務嗎?你可以發佈gradle文件 –

+0

compile'c​​om.google.android.gms:play-services:8.4.0'刪除此行 –

+0

只使用你想要的服務! –

回答

1

我面臨同樣的問題。我解決,通過移除具有15+支持庫不需要播放服務

//compile 'com.google.android.gms:play-services:8.4.0' 
//Don't use play services directly. use only what ever you want 
compile 'com.google.android.gms:play-services-ads:8.4.0' 
compile 'com.google.android.gms:play-services-identity:8.4.0' 
compile 'com.google.android.gms:play-services-gcm:8.4.0' 

播放服務,讓你只想要不添加由谷歌的服務建議充分發揮服務

什麼用 Check Here

Selectively compiling APIs into your executable

In versions of Google Play services prior to 6.5, you had to compile the entire package of APIs into your app. In some cases, doing so made it more difficult to keep the number of methods in your app (including framework APIs, library methods, and your own code) under the 65,536 limit.

From version 6.5, you can instead selectively compile Google Play service APIs into your app. For example, to include only the Google Fit and Android Wear APIs, replace the following line in your build.gradle file:

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

with these lines:

compile 'com.google.android.gms:play-services-fitness:8.4.0'

compile 'com.google.android.gms:play-services-wearable:8.4.0'

shows a list of the separate APIs that you can include when compiling your app, and how to describe them in your build.gradle file. Some APIs > do not have a separate library; include them by including the base library. (This lib is automatically included when you include an API that does have a separate library.)

+0

謝謝@ Poovizhirajan.N這個解決方案爲我工作。另外,我之前發佈的代碼在Android Studio 2.0中編譯。我猜想在新版本的gradle中解決了有關支持lib或播放服務庫的衝突。 –

+0

總是歡迎你......我通過添加相同的fb api來面對這個......我的自我嘗試了multidex和許多方法,沒有閱讀播放服務指令.... –

相關問題