久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

錯誤:在我添加新依賴項時,我的項目中的任務

Error:Execution failed for task #39;:app:dexDebug#39; error in my project while I added new dependency(錯誤:在我添加新依賴項時,我的項目中的任務 :app:dexDebug 錯誤執行失敗) - IT屋-程序員軟件開發技術分享社
本文介紹了錯誤:在我添加新依賴項時,我的項目中的任務 ':app:dexDebug' 錯誤執行失敗的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我沒有在我的項目中(在 libs 中)添加任何庫/罐子,只有這個依賴項.

我的 build.gradle 文件.

<代碼>android {compileSdkVersion 23構建工具版本23.0.1"默認配置 {應用程序IDcom.android.example23"minSdkVersion 14targetSdkVersion 23版本代碼 1版本名稱1.0"}構建類型 {發布 {縮小啟用假proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}}}依賴{編譯文件樹(包括:['*.jar'],目錄:'libs')測試編譯'junit:junit:4.12'編譯'com.android.support:appcompat-v7:23.1.1'編譯'com.android.support:cardview-v7:23.1.1'編譯'com.android.support:recyclerview-v7:23.1.1'編譯'com.android.support:support-v4:23.1.1'編譯 'com.melnykov:floatingactionbutton:1.1.0'編譯'com.android.support:design:23.1.1'編譯'org.apache.directory.studio:org.apache.commons.io:2.4'編譯'com.google.android.gms:play-services:8.3.0'編譯'com.squareup.picasso:picasso:2.5.2'編譯'com.parse:parse-android:1.11.0'編譯'com.naver.android.helloyako:imagecropview:1.0.3'編譯'com.squareup.okhttp:okhttp:2.6.0'}

一旦我將這個compile 'com.squareup.okhttp:okhttp:2.6.0'"添加到我的項目中,我就會得到這個

錯誤:任務 ':app:dexDebug' 執行失敗.

<塊引用>

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:Program FilesJavajdk1.8.0_45injava.exe'' 完成非零退出值 2

運行項目時出現錯誤....

如果我刪除這個compile 'com.squareup.okhttp:okhttp:2.6.0'"依賴,我的程序就可以正常工作了.

有時如果我添加了 Facebook 依賴項,也會出現同樣的錯誤......

解決方案

你也可以使用下面的代碼和 IntelliJ Amiya 答案.在某些情況下,這段代碼對我有用

 dexOptions {增量真javaMaxHeapSize "4g"}安卓 {compileSdkVersion 23構建工具版本23.0.1"默認配置 {minSdkVersion 14//低于14不支持multidextargetSdkVersion 22//啟用多索引支持.multiDexEnabled 真}}

你可以通過創建一個應用程序類來做到這一點

public class MyApplication extends MultiDexApplication { .. }

覆蓋attachBaseContext 方法并調用 MultiDex.install().受保護的無效 attachBaseContext(上下文基礎){super.attachBaseContext(base);MultiDex.install(this);}

否則(如果您的應用程序沒有自定義應用程序實現),請在您的 AndroidManifest.xml 中將 MultiDexApplication 聲明為應用程序實現.

I didn't added any libraries / jars in my project( in libs ) only this dependencies.

My build.gradle file.

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"

defaultConfig {
    applicationId "com.android.example23"
    minSdkVersion 14
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'),    'proguard-rules.pro'
     }
 }
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.melnykov:floatingactionbutton:1.1.0'
compile 'com.android.support:design:23.1.1'
compile 'org.apache.directory.studio:org.apache.commons.io:2.4'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.parse:parse-android:1.11.0'
compile 'com.naver.android.helloyako:imagecropview:1.0.3'
compile 'com.squareup.okhttp:okhttp:2.6.0'
}

Once I am adding this " compile 'com.squareup.okhttp:okhttp:2.6.0' " into my project I am getting this

Error:Execution failed for task ':app:dexDebug'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:Program FilesJavajdk1.8.0_45injava.exe'' finished with non-zero exit value 2

Error is coming while I run my project....

If I remove this " compile 'com.squareup.okhttp:okhttp:2.6.0' " dependency my program is working fine.

Sometimes if I added Facebook dependency also the same error is coming...

解決方案

you can use below code also with IntelliJ Amiya answer. In some case this code work for me

 dexOptions {
    incremental true
    javaMaxHeapSize "4g"
}

android {
compileSdkVersion 23
 buildToolsVersion "23.0.1"

     defaultConfig {
         minSdkVersion 14 //lower than 14 doesn't support multidex
         targetSdkVersion 22

         // Enabling multidex support.
         multiDexEnabled true
     }
}

you can do by make an Application class

public class MyApplication extends MultiDexApplication { .. }

or

override 
 attachBaseContext method and call MultiDex.install().
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}

Otherwise (if your application does not have custom Application implementation), declare MultiDexApplication as application implementation in your AndroidManifest.xml.

<application
android:name="android.support.multidex.MultiDexApplication"
.. >
..
</application>

這篇關于錯誤:在我添加新依賴項時,我的項目中的任務 ':app:dexDebug' 錯誤執行失敗的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

IncompatibleClassChangeError after updating to Android Build Tools 25.1.6 GCM / FCM(更新到 Android Build Tools 25.1.6 GCM/FCM 后出現 IncompatibleClassChangeError)
How to get current flavor in gradle(如何在 gradle 中獲取當前風味)
How to fix quot;unexpected element lt;queriesgt; found in lt;manifestgt;quot; error?(如何修復“意外元素lt;查詢gt;在“清單中找到錯誤?)
Multi flavor app based on multi flavor library in Android Gradle(基于 Android Gradle 中多風味庫的多風味應用)
Android dependency has different version for the compile and runtime(Android 依賴在編譯和運行時有不同的版本)
Transitive dependencies for local aar library(本地 aar 庫的傳遞依賴)
主站蜘蛛池模板: 欧美国产日韩在线 | 中文字幕日韩欧美 | 一级淫片观看 | 日韩欧美国产精品 | av毛片网站| 曰本毛茸茸性生活 | 亚洲综合在线播放 | 欧美人xxxx | 日日狠狠 | 欧美一区二区三区在线视频 | 久久精品一区二区国产 | 在线欧美日韩 | 国产黄色片在线观看 | 超碰在线91 | 日韩久久一区 | 国产精品成人免费视频 | 国产精品久久久久久久久久久久午夜片 | 日韩免费一区 | 亚洲久久视频 | 精品免费国产一区二区三区四区 | 日本不卡二区 | 超碰成人在线观看 | 日本黄色免费视频 | 91亚洲国产成人久久精品网站 | 天堂在线中文资源 | 精品亚洲国产成人av制服丝袜 | 免费观看一区二区 | 亚洲成人中文字幕 | 蜜桃视频一区二区 | 综合久久99| 美女视频福利 | 日韩性生活视频 | 欧美色图一区二区 | 一级黄色片免费看 | 亚洲免费专区 | 色爱综合区| 99久久久久久久 | 中文字幕超清在线观看 | 久久国产美女 | 男人影院在线观看 | 亚洲黄色av|