Android 设计支持库未编译

Android Design Support Library not compiling

我正在尝试添加新的设计支持库,但无法编译。

在进行以下更改之前,我的代码编译得非常好。

我尝试使用以下方式添加它:

 compile 'com.android.support:design:22.2.0'

我删除了:

compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:support-v4:21.0.3'

因为设计支持库里面有这两个库。但是,我的应用无法编译!!

我收到以下错误:

Warning:Dependency xpp3:xpp3:1.1.4c is ignored for productionDebug as it may be conflicting with the internal version provided by Android.
     In case of problem, please repackage it with jarjar to change the class packages

对于我的每种口味 (production/stagingDebug/Release),此错误重复 4 次。

然后它列出了一堆图像错误,例如:

/Users/.../app/src/main/res/drawable-mdpi/ic_chat.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited

然后最后在一堆普通的输出之后,它说:

Error:Execution failed for task ':app:dexStagingDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2

请帮忙:(

在应用程序中 gradle 将此添加到 defaultConfig

multiDexEnabled = true

1:- 将此行添加到清单 申请
android:name="android.support.multidex.MultiDexApplication"

2:- 在应用中 gradle 将此添加到 defaultConfig

 multiDexEnabled = true

3:-将此添加到 Gradle 应用依赖项

编译'com.android.support:multidex:1.0.0'

现在你不会得到任何例外的纯解决方案。 :) 享受