0

I am creating new project with Android Studio 3.2, every time I create a new project either as blank activity, tabbed activity or any other type of project, project runs in error. I tried clean build or invalidating project & restarting android studio. Below are the logs attached:

org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'SampleApp'.
        at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:94)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:66)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.access$100(LifecycleProjectEvaluator.java:34)
        at org.gradle.configuration.project.LifecycleProjectEvaluator$ConfigureProject.run(LifecycleProjectEvaluator.java:110)

.......

Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all artifacts for configuration ':classpath'. ........

Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve org.apache.httpcomponents:httpmime:4.5.2. Required by:
    project : > com.android.tools.build:gradle:3.2.0 > com.android.tools.analytics-library:crash:26.2.0
    project : > com.android.tools.build:gradle:3.2.0 > com.android.tools.build:builder:3.2.0 > com.android.tools:sdklib:26.2.0  at org.gradle.api.internal.artifacts.ivyservice.ivyresolve ...........

Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve org.apache.httpcomponents:httpmime:4.5.2. ......


Caused by: org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.MetaDataParseException: Could not parse POM https://jcenter.bintray.com/org/apache/httpcomponents/httpmime/4.5.2/httpmime-4.5.2.pom ......

There is long list of error popping up.

Here is my app level build.gradle:


apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.sample.example.sampleapp"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

Here is my project level gradle:


buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.0'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
Sumit T
  • 1,273
  • 2
  • 17
  • 32
  • add your build.gradle file.(both the app level and project level) – D_Alpha Dec 10 '18 at 07:10
  • https://stackoverflow.com/questions/49788977/faced-with-org-gradle-api-projectconfigurationexception-error-on-my-gradle-bu try this answer – Choxmi Dec 10 '18 at 07:13
  • Create a [mcve] – Zoe Dec 10 '18 at 09:56
  • @Choxmi: that answer doesn't solves this issue. – Sumit T Dec 11 '18 at 07:08
  • @SumitT : It looks like a bug in 3.2 https://issuetracker.google.com/u/0/issues/72872257 . Try adding `android.enableD8.desugaring=true` to your gradle properties. – Choxmi Dec 11 '18 at 09:49
  • @Choxmi: I tried adding "android.enableD8.desugaring=true" into my project's gradle properties but didn't worked for me. – Sumit T Dec 11 '18 at 19:40
  • @SumitT : I'm out of options. According to the issue tracker, Java 9 cause this issue. If you are not using java 9's specific features, try downgrading to *VERSION_1_7 or JDK 8*. That should definitely fix the issue. – Choxmi Dec 11 '18 at 23:04

0 Answers0