当前位置: 首页 > 知识库问答 >
问题:

在项目“:App”中找不到任务“Prepare ReleaseUnitTestDependencies”

诸葛皓
2023-03-14
buildscript 
{

    repositories {

        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

//subprojects are added here
project(':external:calendar') {
    apply plugin: 'android-library'

    android {
        compileSdkVersion 25
        buildToolsVersion '25.0.1'

        defaultConfig {
            minSdkVersion 19
            targetSdkVersion 25
        }

        sourceSets {
            main {
                manifest.srcFile 'AndroidManifest.xml'
                java.srcDirs = ['src']
                resources.srcDirs = ['src']
                aidl.srcDirs = ['src']
                renderscript.srcDirs = ['src']
                res.srcDirs = ['res']
                assets.srcDirs = ['assets']
            }
        }

        lintOptions {
            abortOnError false
        }
    }
}

project(':external:colorpicker') {
    apply plugin: 'android-library'

    android {
        compileSdkVersion 25
        buildToolsVersion '25.0.1'

        defaultConfig {
            minSdkVersion 19
            targetSdkVersion 25
        }

        sourceSets {
            main {
                manifest.srcFile 'AndroidManifest.xml'
                java.srcDirs = ['src']
                resources.srcDirs = ['src']
                aidl.srcDirs = ['src']
                renderscript.srcDirs = ['src']
                res.srcDirs = ['res']
                assets.srcDirs = ['assets']
            }
        }
    }
}

project(':external:datetimepicker') {
    apply plugin: 'android-library'

    dependencies {
        compile 'com.android.support:support-v4:25.3.1'
    }

    android {
        compileSdkVersion 25
        buildToolsVersion '25.0.1'

        defaultConfig {
            minSdkVersion 19
            targetSdkVersion 25
        }

        sourceSets {
            main {
                manifest.srcFile 'AndroidManifest.xml'
                java.srcDirs = ['src']
                resources.srcDirs = ['src']
                aidl.srcDirs = ['src']
                renderscript.srcDirs = ['src']
                res.srcDirs = ['res']
                assets.srcDirs = ['assets']
            }
        }

        lintOptions {
            abortOnError false
        }
    }
}

project(':external:timezonepicker') {
    apply plugin: 'android-library'

    dependencies {
        compile 'com.android.support:support-v4:25.3.1'
    }

    android {
        compileSdkVersion 25
        buildToolsVersion '25.0.1'

        defaultConfig {
            minSdkVersion 19
            targetSdkVersion 25
        }

        sourceSets {
            main {
                manifest.srcFile 'AndroidManifest.xml'
                java.srcDirs = ['src']
                resources.srcDirs = ['src']
                aidl.srcDirs = ['src']
                renderscript.srcDirs = ['src']
                res.srcDirs = ['res']
            }
        }

        lintOptions {
            abortOnError false
        }
    }
}

project(':external:chips') {
    apply plugin: 'android-library'

    android {
        compileSdkVersion 25
        buildToolsVersion '25.0.1'

        defaultConfig {
            minSdkVersion 19
            targetSdkVersion 25
        }

        sourceSets {
            main {
                manifest.srcFile 'AndroidManifest.xml'
                java.srcDirs = ['src']
                resources.srcDirs = ['src']
                aidl.srcDirs = ['src']
                renderscript.srcDirs = ['src']
                res.srcDirs = ['res']
                assets.srcDirs = ['assets']
            }
        }


        lintOptions {
            abortOnError false
        }
    }
}

apply plugin: 'com.android.application'

dependencies {
    compile 'com.android.support:support-v4:25.3.1'
    compile 'com.android.support:design:25.3.1'
    compile project(':external:calendar')
    compile project(':external:colorpicker')
    compile project(':external:datetimepicker')
    compile project(':external:timezonepicker')
    compile project(':external:chips')
}

android {
    compileSdkVersion 25
    buildToolsVersion '25.0.1'

    defaultConfig {
        minSdkVersion 19
        targetSdkVersion 25
    }

    useLibrary 'org.apache.http.legacy'

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src', 'external/ex/common/java'] // NOTE: this includes external/ex/common/java!
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }
    }

    /*
     * To sign release build, create file gradle.properties in ~/.gradle/ with this content:
     *
     * signingStoreLocation=/home/key.store
     * signingStorePassword=xxx
     * signingKeyAlias=alias
     * signingKeyPassword=xxx
     */
    if (project.hasProperty('signingStoreLocation') &&
            project.hasProperty('signingStorePassword') &&
            project.hasProperty('signingKeyAlias') &&
            project.hasProperty('signingKeyPassword')) {
        println "Found sign properties in gradle.properties! Signing build…"

        signingConfigs {
            release {
                storeFile file(signingStoreLocation)
                storePassword signingStorePassword
                keyAlias signingKeyAlias
                keyPassword signingKeyPassword
            }
        }

        buildTypes.release.signingConfig = signingConfigs.release
    } else {
        buildTypes.release.signingConfig = null
    }

    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }
}

task customClean(type: Delete) {
    delete rootProject.buildDir
}
clean.dependsOn customClean

共有1个答案

狄阳秋
2023-03-14

可能需要从以下位置删除“-X PrepareReleaseUnitTestDependencies”:

设置/生成、执行、部署/编译器/命令行选项

.

 类似资料:
  • 在此处输入图像描述 我从字面上得到这个错误是我打开的所有项目,有谁能帮我修复这个?

  • 我在java代码中使用apollo graphql客户端。我的gradle文件是 我已经遵循了本文中提到的文档https://github.com/apollographql/apollo-android我在第四步和第五步被卡住了。无法添加 在gradle文件中,在执行命令gradlew generateApollo时,在根项目“testProject”中找不到任务“generateApolloS

  • 我遵循了将AAR文件发布到JCenter所需的每一步,然后使用https://github.com/danielemaddaluno/gradle-jcenter-publish.我按照他的步骤13和步骤14写了这个命令,得到了这个错误: G:\Android开发应用程序\Android studio\gradle\gradle-2.2.1\bin 失败:构建失败,但有一个异常。 出错原因: 在根

  • 在0s执行任务时生成失败:[:App:AssembleDebug] 失败:生成失败,出现异常。 > 出错原因:在根项目'demo2'中找不到任务'-continue'。 在https://help.gradle.org获得更多帮助 在0s中生成失败

  • 我试图在android studio 3.1中导入一个项目,但当我尝试构建该项目时,它会显示“在根项目中找不到任务‘汇编’”。我搜索了这个错误,但没有找到直接的答案,像这样的答案对我来说并不适用。有什么解决办法吗? [已解决]:问题是因为缺少设置。格雷德尔档案!只是手动将其添加到主项目文件夹中

  • 我正在尝试使用Maven插件将我的Gradle项目转换为Maven。我遵循这个SO链接,但当我运行Gradle安装命令时,我得到了以下错误 当我执行时,它没有显示安装。在这种情况下该怎么办?