gpt4 book ai didi

android - 任务 ':app:processDebugResources' 执行失败。 Gradle 构建失败

转载 作者:行者123 更新时间:2023-11-29 00:53:59 25 4
gpt4 key购买 nike

在 Android Studio 中构建 Gradle 时遇到错误。我需要在哪里更改代码来解决问题?

这是我的项目build.gradle

buildscript {
repositories {
jcenter{ url "http://jcenter.bintray.com/"}
google()
}
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 {
jcenter()
maven { url "https://jitpack.io" }
maven {
url "https://maven.google.com"
}
google()

}

}


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

这是我的应用程序 build.gradle

apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.atmajaa.adda"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
resConfigs "auto"
manifestPlaceholders = [onesignal_app_id : "01bab543-cce8-4e36-a755-6bc23fd66b7c",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
multiDexEnabled true
dexOptions {
preDexLibraries = false
javaMaxHeapSize "4g"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {

}
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')

implementation('com.mikepenz:fastadapter:2.6.3@aar') {
transitive = true
}
implementation 'com.android.support:appcompat-v7:26.0.2'
implementation 'com.android.support:cardview-v7:26.0.2'
implementation 'com.android.support:support-v4:26.0.2'
implementation 'com.android.support:animated-vector-drawable:26.0.2'
implementation 'com.android.support:design:26.0.2'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.synnapps:carouselview:0.1.4'
implementation 'com.mikepenz:fastadapter-commons:2.6.3@aar'
implementation 'com.mikepenz:fastadapter-extensions:2.6.3@aar'
implementation 'com.miguelcatalan:materialsearchview:1.4.0'
implementation 'org.jsoup:jsoup:1.10.3'
implementation 'com.thefinestartist:finestwebview:1.2.7'
implementation 'com.github.chrisbanes:PhotoView:1.3.1'
implementation 'com.fnp:material-preferences:0.1.4'
implementation 'com.thebluealliance:spectrum:0.7.1'
implementation 'com.firebaseui:firebase-ui-auth:2.3.0'
implementation 'com.google.firebase:firebase-core:17.0.0'
implementation 'com.google.firebase:firebase-crash:16.2.1'
implementation 'com.google.firebase:firebase-invites:17.0.0'
implementation 'com.google.firebase:firebase-ads:18.0.0'
implementation 'com.google.firebase:firebase-auth:18.0.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.onesignal:OneSignal:3.10.9'
implementation 'com.android.support:multidex:1.0.3'
// Required only if Facebook login support is required
implementation('com.facebook.android:facebook-android-sdk:4.22.1')

// Required only if Twitter login support is required
implementation("com.twitter.sdk.android:twitter-core:3.0.0@aar") { transitive = true }
}
apply plugin: 'com.google.gms.google-services'

失败:构建失败,出现异常。

  • 出了什么问题:

    任务“:app:processDebugResources”执行失败。

    Android resource linking failed error: invalid config 'auto' for -c option.

最佳答案

在您的应用级 build.gradle 中,我可以看到您使用了 resConfigs "auto" :

apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.atmajaa.adda"
minSdkVersion 16
targetSdkVersion 26
...
resConfigs "auto"
...
}
}

使用下面的代码代替 auto,如本 documentation reference link 中所述并将您的语言资源定义/限制为您喜欢的任何语言:

android {
defaultConfig {
...
resConfigs "en"
}
}

关于android - 任务 ':app:processDebugResources' 执行失败。 Gradle 构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56660404/

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