A lot of errors building the gradle:
- Gradle Scripts
build.gradle(Project:):
plugins {
id 'com.android.application'
}
android {
compileSdkVersion 31
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.prototype"
minSdkVersion 23
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
proguardFiles
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
//https://developer.android.com/jetpack/androidx/releases/lifecycle
def lifecycle_version = "2.3.1"
def arch_version = "2.1.0"
// ViewModel
implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version"
// LiveData
implementation "androidx.lifecycle:lifecycle-livedata:$lifecycle_version"
// Saved state module for ViewModel
implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:$lifecycle_version"
// alternately - if using Java8, use the following instead of lifecycle-compiler
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
// optional - Test helpers for LiveData
testImplementation "androidx.arch.core:core-testing:$arch_version"
//https://developer.android.com/training/data-storage/room
def room_version = "2.3.0"
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
//https://developers.google.com/identity/sign-in/android/start-integrating
implementation 'com.google.android.gms:play-services-auth:19.2.0'
// https://mvnrepository.com/artifact/com.squareup.picasso/picasso
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
build.gradle(Module:Prototype):
ext {
buildToolsVersion = '30.0.0'
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath 'com.google.gms:google-services:4.3.8'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
gradle-wrapper.properties(Gradle Version)
#Tue Jul 27 13:37:39 BRT 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-6.5.1-bin.zip
ERRORS:
appbuildintermediatesnavigation_jsondebugnavigation.json (The system cannot find the path specified)
appbuildintermediatesmerged_assetsdebugout
appbuildintermediatesmerged_manifestdebugoutAndroidManifest.xml’ specified for property ‘mainMergedManifest’ does not exist.
What i tried to do was:
- Tried Gradle version: 6.5.1 and Gradle Plugin: 4.1.3
- Tried Gradle version: 6.5.0 and Gradle Plugin: 4.1.0
- Tried Gradle version: 6.7.1 and Gradle Plugin: 4.2.0
- https://developer.android.com/studio/releases/gradle-plugin
- Deleting "intermediates" in the build.
- Changing the version min and max and target in the gradle;
- [Copy] all the Classes and [Paste] in a new project.
Sometimes I believe that the error is not in the gradle but in the "room" libraries that I implemented, but the code seems to be according to the notes.Is there something that i must change?
2
Answers
In the end i found a Gradle and plugin that worked was:
Android Gradle plugin Version: 4.0.0 Gradle Version: 6.1.1
But i don't know if has something to do with the building but i found some bugs in the classes room, and it seems the builder was giving message error of the build process not the classes with the bugs.
I have encountered similar errors. My projects were on an SD card with FAT32 file system. The problem with this is that FAT32 does not support symbolic links.
Try not to store gradle projects on an SD card or any storage with a FAT32 file system.