I am building an Android project with a small team.
After implementing Facebook's Login system, I am no longer able to run my project, although it will build without problems.
The error: Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
Failed to create MD5 hash for file 'C:\\Users\\me\\folder\\app\\src\\main\\java\\com\\team\\app\\httpclient-4.5.3.jar'.
If I go to my build.gradle module:app, I can see the line:
compile files('src/main/java/com/folder/app/httpclient-4.5.3.jar')
If I comment this out, the next compile line fails to make an MD5 hash.
I was able to run it, so I don't think its my path variable or JDK. I reinstalled JDK1.8. I have tried using the Android default JDK. I have added every path I could think of to my EnvVar.
After reading the other 10 SO articles about the same thing, I have made 0 ground.
Below is the full gradle file, but with naming details removed.
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.our.app"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:cardview-v7:26.+'
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.+'
compile 'org.jetbrains:annotations-java5:15.0'
compile 'com.android.support:customtabs:26.0.0-alpha1'
compile files('src/main/java/com/our/app/httpclient-4.5.3.jar')
compile files('src/main/java/com/our/app/commons-codec-1.9.jar')
compile files('src/main/java/com/our/app/commons-logging-1.2.jar')
compile files('src/main/java/com/our/app/fluent-hc-4.5.3.jar')
compile files('src/main/java/com/our/app/httpclient-cache-4.5.3.jar')
compile files('src/main/java/com/our/app/httpclient-win-4.5.3.jar')
compile files('src/main/java/com/our/app/httpcore-4.4.6.jar')
compile files('src/main/java/com/our/app/httpmime-4.5.3.jar')
compile files('src/main/java/com/our/app/jna-4.1.0.jar')
compile files('src/main/java/com/our/app/jna-platform-4.1.0.jar')
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
testCompile 'junit:junit:4.12'
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if(requested.group == 'com.android.support'){
if(!requested.name.startsWith("multidex")){
details.useVersion '25.3.0'
}
}
}
}
Again, I am not trying to ask the same question over and over on here, but I have yet to find a solution to my problem.
Thanks in advance for any help you can provide. If I made some posting mistakes, please correct me so that I can draw the best attention to this post and not a bunch of people screaming about format.
compile 'com.facebook.android:facebook-android-sdk:4.22.0'
Try to compile like this. I don't know whether this will work or not. But give it a try. Also, try to group compile dependencies together.
I had several building issues on my desktop, and the errors varried. Sometimes md5
errors, and sometimes errors in my build
folder.
My solution was to disable my Anti-Virus, and that worked out pretty well. I was using Bitdefender on Windows.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.