gpt4 book ai didi

android - 在项目 'prepareReleaseUnitTestDependencies' 中找不到任务 ':app'

转载 作者:行者123 更新时间:2023-11-30 00:28:40 24 4
gpt4 key购买 nike

我在构建我的 android 项目时在控制台中收到此错误。请帮助我理解这一点。

消息:

错误:失败:构建失败并出现异常。

  • 出了什么问题:在项目“:app”中找不到任务“prepareReleaseUnitTestDependencies”。

  • 尝试:运行 gradle tasks 以获取可用任务的列表。使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。

Gradle :

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

最佳答案

也许您需要从以下位置删除“-x prepareReleaseUnitTestDependencies”:

Setting / build,execution, deployment/ compiler/ command-line Options

.

关于android - 在项目 'prepareReleaseUnitTestDependencies' 中找不到任务 ':app',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44885680/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com