java 无法创建 MD5 哈希文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/42621544/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 06:46:10  来源:igfitidea点击:

Unable to create MD5 Hash file?

javaandroidhashmd5

提问by Isha Gupta

My error is : Error:Execution failed for task ':app:compileDebugJavaWithJavac'.

我的错误是:错误:任务 ':app:compileDebugJavaWithJavac' 的执行失败。

Failed to create MD5 hash for file 'D:\Android\AsianNEws\PNRstatus\app\libs\httpclient-4.3.6.jar'.

无法为文件“D:\Android\AsianNEws\PNRstatus\app\libs\httpclient-4.3.6.jar”创建 MD5 哈希。

My Gradle file is :

我的 Gradle 文件是:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    useLibrary 'org.apache.http.legacy'
    defaultConfig {
        applicationId "com.example.hp_pc.pnrstatus"
        minSdkVersion 21
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    packagingOptions{
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile files('libs/httpclient-4.3.6.jar')
    compile files('libs/httpcore-4.3.3.jar')
    compile files('libs/httpmime-4.3.6.jar')
   // compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5.1'
    compile 'com.android.support:appcompat-v7:25.1.0'
    compile 'com.android.support:design:25.1.0'
    compile 'com.android.support.constraint:constraint-layout:+'
   // compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5.1'
    testCompile 'junit:junit:4.12'
}

回答by RAJESH KUMAR ARUMUGAM

In my case, I got the same Error Because of Spell Mistake in

就我而言,由于拼写错误,我遇到了同样的错误

compile files('lib/httpclient-4.3.6.jar')  and solved by correcting the spelling to libs

Please Check the Spellings Correctly Or You may try this

请正确检查拼写或您可以试试这个

  compile files('libs/httpclient-4.3.6.jar','libs/httpcore-4.3.3.jar','libs/httpmime-4.3.6.jar')

PS: HttpClientwas Deprecated One and Not Recommended. Please Consider OkHttpfor future Projects

PS:HttpClient已被弃用,不推荐使用。请在未来的项目中考虑使用OkHttp

回答by tasu khalifa

I too had the same problem.just changed libsto liband it worked. Check the spells correctly.

我也有同样的问题。只是将libs更改为lib并且它起作用了。正确检查拼写。