The gradle fails to build with the following error message:
/home/researcher/.android/build-cache.lock Open File
Run build error:
org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: Build file '/home/researcher/AndroidStudioProjects/EmApp/app/build.gradle' line: 1 A problem occurred evaluating project ':app'. at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:139) at org.gradle.initialization.DefaultGradleLauncher.getConfiguredBuild(DefaultGradleLauncher.java:104) at org.gradle.internal.invocation.GradleBuildController$2.call(GradleBuildController.java:87) .......
and much more. I couldn't exactly figure out what is wrong and why this happens.
This is my build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.researcher.emapp"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}`
Please help me fix this problem.
Edit1: Deleting home/researcher/.android/build-cache.lock can't be done as there's no such file in .android The ls command:
researcher@researcher1:~$ cd /home/researcher/.android
researcher@researcher1:~/.android$ ls
adbkey adbkey.pub uid.txt
I have pointed out to the installed jdk as mentioned in this question , But in vain. Please help me fix this issue. Thanks:)