java - 无法创建 MD5 哈希文件?

标签 java android hash md5

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

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

我的 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'
}

最佳答案

在我的例子中,由于拼写错误,我得到了同样的错误

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

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

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

PS:HttpClient 已被弃用,不推荐使用。请考虑 OkHttp 用于 future 的项目

关于java - 无法创建 MD5 哈希文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42621544/

相关文章:

java - 如何在java中标记输入文件

java - 在 json 输出中获取对象时遇到问题

java - 如何做mvn scm插件匿名pserver cvs访问

java - 在 Java 中获取子进程 ID

android - 使用不同的参数调用 AsyncTask

android - 如何从 txt 文件中获取某些值?

android - 有没有办法在 android Jetpack Compose 中自定义 LazyRow 拖动或滚动行为?

hash - 手工/数学地做哈希

C:用于创建 HashMap 以使用链接存储字符串的指针

python - 两个整数具有相同的哈希值