简体   繁体   English

Android设计支持库未编译

[英]Android Design Support Library not compiling

I'm trying to add in the new Design Support library but it won't compile. 我正在尝试添加新的设计支持库,但无法编译。

Before making the following changes, my code compiled perfectly fine. 在进行以下更改之前,我的代码已完美编译。

I tried adding it using: 我尝试使用添加它:

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

And I removed: 我删除了:

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

Since the design support library has these two libraries inside it. 由于设计支持库中包含这两个库。 However, my app won't compile!! 但是,我的应用程序无法编译!

I get the following error: 我收到以下错误:

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

This error is repeated 4 times for each of my flavours (production/stagingDebug/Release). 对于我的每种口味(生产/调试/发布),此错误重复4次。

It then lists a bunch of image errors such as: 然后,它列出了一堆图像错误,例如:

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

Then finally after a bunch of common output, it says: 然后,在经过一堆共同的输出之后,它最终说:

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

Pls help :( 请帮助:(

In app gradle add this to defaultConfig 在应用程序gradle中将其添加到defaultConfig

multiDexEnabled = true multiDexEnabled = true

1:- Add this Line to Manifest Application 1:-将此行添加到清单应用程序
android:name="android.support.multidex.MultiDexApplication" android:name =“ android.support.multidex.MultiDexApplication”

2:- In app gradle add this to defaultConfig 2:-在应用gradle中将其添加到defaultConfig

 multiDexEnabled = true

3:-add this in Gradle app dependencies 3:在Gradle应用程序依赖项中添加

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

Now you won't get any exception its pure solution. 现在,您将无法获得纯解决方案的任何例外。 :) Enjoy :) 请享用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM