Gradle не удается построить со следующим сообщением об ошибке:
/home/researcher/.android/build-cache.lock Open File
Ошибка сборки:
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) .......
и многое другое. Я не мог точно понять, что не так и почему это происходит.
Это мой файл build.gradle:
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'
}`
Пожалуйста, помогите мне решить эту проблему.
Edit1: удаление home / research / .android / build-cache.lock невозможно, так как такого файла нет в .android Команда ls:
researcher@researcher1:~$ cd /home/researcher/.android
researcher@researcher1:~/.android$ ls
adbkey adbkey.pub uid.txt
Я указал на установленный jdk, как упоминалось в этот вопрос, а зря. Пожалуйста, помогите мне решить эту проблему. Спасибо:)
@AkshayMahajan такого файла нет в .android
researcher@researcher1:~$ cd /home/researcher/.android researcher@researcher1:~/.android$ ls adbkey adbkey.pub uid.txt
Удалите файл /home/researcher/.android/build-cache.lock и перезапустите сборку.