#StackBounty: #java #android #gradle #kotlin Gradle build failed with message: TaskDependencyResolveException: Could not determine the …

Bounty: 50

I have updated Android Studio to 3.3 and now I can’t build one of my existing project, I have tried invalidate/restart, also checked gradle-wrapper.propertieswhere gradle version is latest update:

distributionUrl=https://services.gradle.org/distributions/gradle-4.10.1-all.zip

Here is my build.gradle

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'realm-android'
apply plugin: 'kotlin-kapt'

buildscript {
    ext.kotlin_version = '1.3.11'
    repositories {
        google()
        jcenter()
        mavenCentral()
        maven {
            url 'https://maven.google.com'
        }
    }

dependencies {
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.android.tools.build:gradle:3.3.0'
    classpath 'com.google.gms:google-services:4.2.0'
    classpath "io.realm:realm-gradle-plugin:3.1.3"
    }
}

repositories {
    google()
    jcenter()
    mavenCentral()
    maven { url "https://jitpack.io" }
    maven {
        url 'https://maven.google.com'
    }

}


androidExtensions {
    experimental = true
}

android {
    compileSdkVersion 22
    buildToolsVersion '28.0.3'
    defaultConfig {
        applicationId "my.package.name"
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 1
        versionName "1.0.0"
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
        ndk {
            abiFilters "armeabi-v7a", "x86", "armeabi", "mips"
        }
    }

    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            ....
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
            jniLibs.srcDir 'libs'   
        }

        androidTest.setRoot('tests')

        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
    buildTypes {
    }
}

ext {
    supportLibraryVersion = '22.2.0'
    googleServicesVersion = '17.3.4'
    retrofitVersion = '2.3.0'
}

dependencies {
    implementation fileTree(include: '*.jar', dir: 'libs')
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    [
            'cardview-v7', 'design'
    ].each {
        implementation "com.android.support:$it:$supportLibraryVersion"
    }

    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"


    implementation 'org.jetbrains.anko:anko-sdk23:0.9.1'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.squareup:otto:1.3.8'
    implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
    implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion"
    implementation 'com.squareup.okhttp3:okhttp:3.11.0'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.8.1'
    implementation "com.google.firebase:firebase-messaging:$googleServicesVersion"
}

apply plugin: 'com.google.gms.google-services'

When I’m trying to build project preDebugBuild error appears

org.gradle.api.UncheckedIOException: Failed to capture fingerprint of input files for task ':preDebugBuild' property 'compileManifests' during up-to-date check.

and Java compiler: (1 error)

Caused by: java.lang.ArrayIndexOutOfBoundsException: 1

If I run assembleDebug

* Exception is:
org.gradle.api.internal.tasks.TaskDependencyResolveException: 
Could not determine the dependencies of task ':compileDebugKotlin.' 
...
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1 

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.

Also if run ./gradlew build -Dorg.gradle.warning.mode=all

The project name 'myapp-android production' contains at least one of the following characters:
[ , /, , :, <, >, ", ?, *, |]. This has been deprecated and is scheduled to be removed in Gradle 5.0. 
Set the 'rootProject.name' or adjust the 'include' statement
 (see https://docs.gradle.org/4.10.1/dsl/org.gradle.api.initialization.Settings.html#org.gradle.api.initialization.Settings:include(java.lang.String[])
 for more details)

Could not resolve compiler classpath. 
Check if Kotlin Gradle plugin repository is configured in root project 'myapp-android production'
FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':compileReleaseKotlin'.

How can I resolve this issue? This happened after Android Studio update.


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.