android build gradle error (android 3.1.3) - android

I reinstalled my android studio and thereafter i am getting error while building gradle.
I did every change that can help in building gradle but then also it showed error as "configure build" error.
so kindly help me so that i can start my android programming.
gradle version - 4.4
android plugin version - 3.1.3`
i have changed google() to maven() but nothing happened.
//build.gradle file
// Top-level build file where you can add configuration options common to all
sub-projects/modules.
buildscript {
repositories {
google()
jcenter { url 'http://jcenter.bintray.com' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
// 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
}

Related

Android Studio building issues - Could not resolve all artifacts for configuration

While building android app, Attached the issue i’m facing. Could not resolve all artifacts for configuration
Below is the project level gradle file i'm using.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
}
}
allprojects {
repositories {
google()
jcenter()
flatDir {
dirs 'libs'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I tried with gradle build tools versions(4.0.2, 4.1.0), still getting the same issue. 'Could not resolve all artifacts for configuration'
I’m using
Android Studio 4.1.2, working on always on VPN in windows machine, Before this(always on VPN) it used to work for me. Somehow this is not working now. Could some one help me one this.
you need to add this :
buildscript {
ext.kotlin_version = '1.4.10'
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

Getting Error Process unexpectedly exit in Android Studio Version 4.0

I am having Android Studio Version 4.0 and using gradle in gradle.project
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.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
}
I am getting error Process Unexpectedly Exit.
Please help me to fix this issue
Go to File->Project-Structure->Project
Change Android Gradle Plugin Version to 3.3.2 or the last stable version for you Let the Gradle Version to 5.1.1
Click Ok and sync

Could not find com.android.tools.build:gradle:3.0.1. project from Github

I would like to open ten https://github.com/mukundmadhav/Wordpress-to-Android-app project in Android Studio. However, I have a problem.
I'm getting errors
ERROR: Could not find com.android.tools.build:gradle:3.0.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar
Required by:
project :
Add Google Maven repository and sync project
Open File
I tried to solve the problem with these methods
Gradle 4.1 issue on latest android studio 3.0.1
Could not find com.android.tools.build:gradle:3.0.1
Could not find com.android.tools.build.gradle:3.0.0-alpha7
However, nothing helped, does anyone know how to open this project?
Update:
Android Version 3.4.1
build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://maven.google.com" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
There should be google() repo in repositories which searches plugins/libraries in google repository.
Also, version number for com.android.tools.build should match the Android Studio Version. For example: for Android studio 3.4.1, classpath dependency should be:
classpath 'com.android.tools.build:gradle:3.4.1'
Here is the modified code for build.gradle.
// 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.4.1'
classpath 'com.google.gms:google-services:4.2.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
}
Check if google() is present in repositories in the top level build.gradle
allprojects {
repositories {
jcenter()
google()
}
}
P.S - If you're using Android Studio 3.1 or higher, you should be able to click on Add Google Maven repository and sync project and allow Android Studio to make the necessary corrections by itself and resync the gradle.

Android studio build failed. Could not find method allprojects() for arguments

I tried to build my ionic application on Android using Capacitor. But when I tried to build and run an application on android studio, it gives this error. I don't have any android studio knowledge. The error:
Could not find method allprojects() for arguments [build_al8rrgnflynwtjpadzojip71i$_run_closure1#68017a4f] on settings 'android' of type org.gradle.initialization.DefaultSettings.
The build.gradle file:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.google.gms:google-services:4.2.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
}
Instead of allprojects in root project gradle, there is another repositories block in dependencyResolutionManagement, which worked for me.

Gradle project sync failed in android studio 3.1

my gradle.build contains
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.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
}
and upon syncing project with gradle files is showing error as connection refused:connect .
There is a problem with Apply script build.gradle
Not able to resolve dependencies of classpath
Log file showing the below error
Caused by: org.gradle.internal.resource.transport.http.HttpRequestException: Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.1.0/gradle-3.1.0.pom'.
at org.gradle.internal.resource.transport.http.HttpClientHelper.performRequest(HttpClientHelper.java:96)
Try using invalidate caches and restart in File Menu. Most of the time it works when studio have a new update.
Goto "File > Project Structure > SDK Location" menu and
Check "Use embedded JDK(recommended)".
It may be your JDK version problem.

Categories

Resources