Jamsakino
Jamsakino

Reputation: 45

aapt2 3.5.0-5435860 windows gradle error on Android Studio

I am having some issue with my android studio, I recently updated my android studio to version 3.5 and since then I having been encountering with Gradle build error.

I even went ahead and created a new project with no code and an empty activity, when sync it compile without any issue. but upon launching it on my virtual device emulator, it brings this Gradle error

C:\Users.gradle\caches\transforms-2\files-2.1\995db56542b8715d4dfc10fddfcc653d\aapt2-3.5.0-5435860-windows

Config file

// 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:3.5.0'

        // 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
}

App's config:

[apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "com.loyalteams.application"
        minSdkVersion 21
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: \['*.jar'\])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}][1]

Upvotes: 1

Views: 1728

Answers (3)

utrucceh
utrucceh

Reputation: 1116

Finally I found, I try change versions and more (taked one day from me)
Do those steps:

  • Remove .gradle directories
  • Remove all *.iml files
  • Remove .idea files
  • Reopen project
  • Remove intellij system directory (it is contains caches)

Everyhitg work fine ;)

Upvotes: 0

Inaki Quintero
Inaki Quintero

Reputation: 69

In the main configuration file build.gradle compare what lines you have for example I have these:

gradle

What was missing is that of google() in the allprojects;

========================================================== The gradle-wrapper.properties configuration file should look like this:

gradle-wrapper.properties

Upvotes: 0

Jamsakino
Jamsakino

Reputation: 45

I was able to fix it, it was due to paint virus that was on my pc, so during Gradle runtime and build, the hijack any exe file resulting in Gradle cache build error.

As the sole aim of this malware was to affect any runnable exe file on one's desktop and at the same time reduce the size to some kb.

What I did to fix the issue was to install Malwarebytes and Rkill to fix the issue.

I hope this helps some of us being face with the same issue.

Upvotes: 1

Related Questions