2016-04-13 5 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

私は自分のアプリを変更しました。このアプリで使用される説明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'

任意のアイデアとしてのGradleファイル? ありがとう、

+0

あなたはgradleでプレイサービスを利用しましたか?あなたはgradleファイルを投稿できますか? –

+0

コンパイル 'com.google.android.gms:play-services:8.4.0'この行を削除します –

+0

あなただけのサービスを使いましょう! –

答えて

1

私は同じ問題に直面しました。あなたは、Googleのサービスによって推奨フルプレイサービス

を追加いけない欲しいものだけを使用する必要がありますので、私は15+サポートLIBSを持つ不要なプレイサービス

//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のサポートやサービスのlibの再生に関する対立を修正したと思う。 –

+0

あなたの歓迎はいつも...私は同じfb apiを追加することでこれに直面しました...私の自己は、プレイサービスの指示を読んでいなくても、 –

0

Facebook SDKで作業しても同じ問題がありました。これは解決策です:How to enable multidexing with the new Android Multidex support library

+0

自分自身を起動するためにmuti dexを有効にしないでください。メソッドのサイズを減らそうとします。 –

+0

はい、そうです。まず、メソッドのサイズを小さくする必要があります。しかし、それを試した後も、64K以上のメソッドが得られます。マルチデクスを有効にする時です。 – sonngaytho