# Gradle build fail

**URL:** <https://discuss.gradle.org/t/gradle-build-fail/45065>\
**Category:** Help/Discuss\
**Created:** [March 3, 2023, 10:31am UTC](https://discuss.gradle.org/t/gradle-build-fail/45065 "2023-03-03T10:31:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![finnintendent](https://avatars.discourse-cdn.com/v4/letter/f/ebca7d/32.png) [@finnintendent](https://discuss.gradle.org/u/finnintendent)\
**Post date:** [March 3, 2023, 10:31am UTC](https://discuss.gradle.org/t/gradle-build-fail/45065/1 "2023-03-03T10:31:38Z")

</div>

FAILURE: Build failed with an exception.

- What went wrong:  
A problem occurred configuring root project ‘android’.

> Could not resolve all files for configuration ‘:classpath’.  
> Could not find com.android.tools.build:gradle:8.0.1.  
> Searched in the following locations:  
> - [https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/8.0.1/gradle-8.0.1.pom](https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/8.0.1/gradle-8.0.1.pom)  
> - [https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/8.0.1/gradle-8.0.1.pom](https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/8.0.1/gradle-8.0.1.pom)  
> Required by:  
> project :

- Try:

> Run with --stacktrace option to get the stack trace.  
> Run with --info or --debug option to get more log output.  
> Run with --scan to get full insights.

I always get this exception when I try to run my program.

buildscript {  
ext.kotlin\_version = ‘1.8.0’  
repositories {  
google()  
mavenCentral()  
}

```
dependencies {
    classpath 'com.android.tools.build:gradle:8.0.1'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

```

}

allprojects {  
repositories {  
google()  
mavenCentral()  
}  
}

This is in my build.gradle file. I tried several different gradle versions but none worked

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [March 3, 2023, 4:35pm UTC](https://discuss.gradle.org/t/gradle-build-fail/45065/2 "2023-03-03T16:35:05Z")

</div>

Don’t confuse Gradle versions with Android Gradle Plugin versions.  
The latest Gradle version is 8.0.1.  
But the latest Android Gradle Plugin version is 7.4.2.

---

<div class="post-metadata">

**Author:** ![finnintendent](https://avatars.discourse-cdn.com/v4/letter/f/ebca7d/32.png) [@finnintendent](https://discuss.gradle.org/u/finnintendent)\
**Post date:** [March 4, 2023, 11:07am UTC](https://discuss.gradle.org/t/gradle-build-fail/45065/4 "2023-03-04T11:07:30Z")

</div>

FAILURE: Build failed with an exception.

- Where:  
Initialization script ‘C:\Users\finni\AppData\Local\Temp\ijmapper.gradle’

- What went wrong:  
Could not compile initialization script ‘C:\Users\finni\AppData\Local\Temp\ijmapper.gradle’.

> startup failed:  
> General error during conversion: Unsupported class file major version 63

Now this error comes up, after I changes the gradle version back to 7.4.2, with this being the updates build.gradle file:

buildscript {  
repositories {  
mavenCentral()  
google()  
}  
dependencies {  
classpath ‘com.android.tools.build:gradle:7.4.2’  
classpath “org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin\_version”  
}  
}

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [March 4, 2023, 12:35pm UTC](https://discuss.gradle.org/t/gradle-build-fail/45065/5 "2023-03-04T12:35:17Z")

</div>

Again, you did not change the Gradle version, you changed the version of the Android Gradle Plugin.

But what Gradle version are you using? I guess something below 7.6. Because your message now says that you want to use Java 19 stuff with something that is not compatible with Java 19 like Gradle versions below 7.6: [Compatibility Matrix](https://docs.gradle.org/current/userguide/compatibility.html)

So if my assumption is right, either use an older Java version that is supported, or use a newer Gradle version.

---

<div class="post-metadata">

**Author:** ![finnintendent](https://avatars.discourse-cdn.com/v4/letter/f/ebca7d/32.png) [@finnintendent](https://discuss.gradle.org/u/finnintendent)\
**Post date:** [March 4, 2023, 8:58pm UTC](https://discuss.gradle.org/t/gradle-build-fail/45065/6 "2023-03-04T20:58:50Z")

</div>

yes, thank you, that worked now! But now I got this mistake. Could you help me there please?

A build operation failed.  
Could not resolve all files for configuration ‘:path\_provider\_android:androidApis’.  
Could not resolve all files for configuration ‘:path\_provider\_android:androidApis’.  
Failed to transform android.jar to match attributes {artifactType=android-mockable-jar, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime, returnDefaultValues=true}.  
Execution failed for MockableJarTransform: C:\Users\finni\AppData\Local\Android\sdk\platforms\android-31\android.jar.  
Cannot create mockable android.jar  
C:\Users\finni\AppData\Local\Android\sdk\platforms\android-31\android.jar

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [March 5, 2023, 3:12pm UTC](https://discuss.gradle.org/t/gradle-build-fail/45065/7 "2023-03-05T15:12:57Z")

</div>

No, I have no idea about Android.  
You might better ask in some Android community about it.  
And you might check whether `--info` and `--stacktrace` maybe give more information about the problem.
