Sunday, December 10, 2023

Build failed with an exception

 Build failed with an exception

* What went wrong:

Plugin [id: 'com.android.application'] was not found in any of the following sources



Solution 1




then  ---

Run the following command:

gradle init

This command will prompt you to choose a type of project. You can select the default option (basic) or choose a different project type based on your needs.


then go to this file : -


gradle > wrapper > gradle-wrapper.properties


distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
#distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip


then project build gradle :- letest android tools build gradle


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


Solution 2

// Add this line in project build.gradle file

dependencies {
classpath "com.android.tools.build:gradle:7.3.0"
}




No comments:

Post a Comment

Featured post

Compress Image With Show File Size & Resolution in Flutter

 Compress Image With Show File Size & Resolution  1.Multiple File Image Compress with file Size import 'dart:io' ; import 'p...

LightBlog