构建失败 10秒30毫秒 运行构建 9秒822毫秒 加载构建 10毫秒 配置构建 413毫秒 计算任务图 566毫秒 运行任务 8秒826毫秒 null
C:/Users/my name/.gradle/caches/transforms-1/files-1.1/appcompat-v7-28.0.0-alpha1.aar/24c78a15e89c609bfeae2b7928d5d678/res/values-v26/values-v26.xml
C:/Users/my name/.gradle/caches/transforms-1/files-1.1/appcompat-v7-28.0.0-alpha1.aar/24c78a15e89c609bfeae2b7928d5d678/res/values-v28/values-v28.xml
W:/android-studio-projects/sharedid C:/Users/my name/.gradle/caches/transforms-1/files-1.1/appcompat-v7-28.0.0-alpha1.aar/24c78a15e89c609bfeae2b7928d5d678/res/values/values.xml null 关联引用失败。
"运行任务"日志为:
org.gradle.api.tasks.TaskExecutionException: 任务执行失败:':app:processDebugResources'。 在 org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100) 在 org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70) 在 org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51) 在 org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62) 在 org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54) 在 org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60) 在 org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97) 在 org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87) 在 org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52) 在 org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52) 在 org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54) 在 org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) 在 org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34) 在 org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248) ...
...
在我的
W:\android-studio-projects\sharedid\app\src\main\AndroidManifest.xml
我有的文件
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="25"
/>
...
In my
W:\android-studio-projects\sharedid\app\build.gradle
我手头拥有的文件
compileSdkVersion 25
and
dependencies {
api 'com.google.android.gms:play-services-maps:+'
api 'com.google.android.gms:play-services-location:+'
api 'com.android.support:appcompat-v7:+'
api 'com.github.PhilJay:MPAndroidChart:v2.0.8'
}
也尝试过
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.android.gms:play-services-maps:+'
implementation 'com.google.android.gms:play-services-location:+'
implementation 'com.android.support:appcompat-v7:+'
implementation 'com.github.PhilJay:MPAndroidChart:v2.0.8'
}
这里是整个文件
android {
defaultConfig {
applicationId "com.example.customer.app"
}
signingConfigs {
release {
}
}
compileSdkVersion 25
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
signingConfig signingConfigs.release
}
}
repositories {
maven { url "https://jitpack.io" }
}
}
dependencies {
api 'com.google.android.gms:play-services-maps:+'
api 'com.google.android.gms:play-services-location:+'
api 'com.android.support:appcompat-v7:+'
api 'com.github.PhilJay:MPAndroidChart:v2.0.8'
}
...
My
W:\android-studio-projects\sharedid\build.gradle
看起来像这样
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
我在解决Android问题时感到迷茫...似乎这不是由我的代码引起的,而是由appcompat引起的。无论如何,有什么方法可以解决/修复这个问题吗?
...
更新4月23日: 我已经进行了以下修复
在W:\android-studio-projects\sharedid\build.gradle中
dependencies {
classpath 'com.android.tools.build:gradle:+'
}
在 W:\android-studio-projects\sharedid\app\build.gradle 中。
defaultConfig {
applicationId "com.example.company.app"
minSdkVersion 14
compileSdkVersion 25
}
这导致了一系列新的错误-但我认为这是进步:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:processDebugResources'. at
...
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) at java.lang.Thread.run(Thread.java:745) Caused by: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed Output: W:\android-studio-projects\sharedid\app\src\main\res\drawable\layerlist_micratingstars.xml:3: warn: generated id 'android:id/background' for external package 'android'. W:\android-studio-projects\sharedid\app\src\main\res\drawable\layerlist_micratingstars.xml:5: warn: generated id 'android:id/progress' for external package 'android'. W:\android-studio-projects\sharedid\app\src\main\res\drawable\layerlist_micratingstars.xml:4: warn: generated id 'android:id/secondaryProgress' for external package 'android'. W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v26\values-v26.xml:7: error: resource android:attr/colorError not found. W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v26\values-v26.xml:11: error: resource android:attr/colorError not found. W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v26\values-v26.xml:15: error: style attribute 'android:attr/keyboardNavigationCluster' not found. W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found. W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found. W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:235: error: resource android:attr/fontStyle not found. W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:235: error: resource android:attr/font not found. W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:235: error: resource android:attr/fontWeight not found. W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:235: error: resource android:attr/fontVariationSettings not found. W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:235: error: resource android:attr/ttcIndex not found. error: failed linking references.
Command: C:\Users\%Username%.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-alpha11-4662957-windows.jar\fc4f56a13b0b656fb51bcc296aa62bd7\aapt2-3.2.0-alpha11-4662957-windows\aapt2.exe link -I\ D:\Java-Android-SDK\platforms\android-25\android.jar\ --manifest\ W:\android-studio-projects\sharedid\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\ -o\ W:\android-studio-projects\sharedid\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\ -R\ @W:\android-studio-projects\sharedid\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\ --auto-add-overlay\ --java\ W:\android-studio-projects\sharedid\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\ --custom-package\ com.example.company.app\ -0\ apk\ --output-text-symbols\ W:\android-studio-projects\sharedid\app\build\intermediates\symbols\debug\R.txt\ --no-version-vectors Daemon: AAPT2 aapt2-3.2.0-alpha11-4662957-windows Daemon #0 Output: W:\android-studio-projects\sharedid\app\src\main\res\drawable\layerlist_micratingstars.xml:3: AAPT: warn: generated id 'android:id/background' for external package 'android'.
W:\android-studio-projects\sharedid\app\src\main\res\drawable\layerlist_micratingstars.xml:5: AAPT: warn: generated id 'android:id/progress' for external package 'android'.
W:\android-studio-projects\sharedid\app\src\main\res\drawable\layerlist_micratingstars.xml:4: AAPT: warn: generated id 'android:id/secondaryProgress' for external package 'android'.
C:\Users\%UserName%.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha1.aar\19b5707f382b2fef8a056030a0107fe4\res\values-v26\values-v26.xml:9:5-12:13: AAPT: error: resource android:attr/colorError not found.
C:\Users\%UserName%.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha1.aar\19b5707f382b2fef8a056030a0107fe4\res\values-v26\values-v26.xml:13:5-16:13: AAPT: error: resource android:attr/colorError not found.
C:\Users\%UserName%.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha1.aar\19b5707f382b2fef8a056030a0107fe4\res\values-v26\values-v26.xml:17:5-93: AAPT: error: style attribute 'android:attr/keyboardNavigationCluster' not found.
C:\Users\%UserName%.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha1.aar\19b5707f382b2fef8a056030a0107fe4\res\values-v28\values-v28.xml:9:5-12:13: AAPT: error: resource android:attr/dialogCornerRadius not found.
W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: AAPT: error: resource android:attr/dialogCornerRadius not found.
C:\Users\%UserName%.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha1.aar\19b5707f382b2fef8a056030a0107fe4\res\values\values.xml:148:5-153:84: AAPT: error: resource android:attr/fontStyle not found.
C:\Users\%UserName%.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha1.aar\19b5707f382b2fef8a056030a0107fe4\res\values\values.xml:148:5-153:84: AAPT: error: resource android:attr/font not found.
C:\Users\%UserName%.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha1.aar\19b5707f382b2fef8a056030a0107fe4\res\values\values.xml:148:5-153:84: AAPT: error: resource android:attr/fontWeight not found. C:\Users\%UserName%.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha1.aar\19b5707f382b2fef8a056030a0107fe4\res\values\values.xml:148:5-153:84: AAPT: error: resource android:attr/fontVariationSettings not found. C:\Users\%UserName%.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha1.aar\19b5707f382b2fef8a056030a0107fe4\res\values\values.xml:148:5-153:84: AAPT: error: resource android:attr/ttcIndex not found. error: failed linking references. Command: C:\Users\%UserName%.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-alpha11-4662957-windows.jar\fc4f56a13b0b656fb51bcc296aa62bd7\aapt2-3.2.0-alpha11-4662957-windows\aapt2.exe link -I\ D:\Java-Android-SDK\platforms\android-25\android.jar\ --manifest\ W:\android-studio-projects\sharedid\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\ -o\ W:\android-studio-projects\sharedid\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\ -R\ @W:\android-studio-projects\sharedid\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\ --auto-add-overlay\ --java\ W:\android-studio-projects\sharedid\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\ --custom-package\ com.example.company.app\ -0\ apk\ --output-text-symbols\ W:\android-studio-projects\sharedid\app\build\intermediates\symbols\debug\R.txt\ --no-version-vectors Daemon: AAPT2 aapt2-3.2.0-alpha11-4662957-windows Daemon #0 at com.android.build.gradle.internal.res.Aapt2ErrorUtils.rewriteException(Aapt2ErrorUtils.kt:97) at com.android.build.gradle.internal.res.Aapt2ErrorUtils.rewriteLinkException(Aapt2ErrorUtils.kt:73) at com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask.invokeAaptForSplit(LinkApplicationAndroidResourcesTask.java:519) at com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask.doFullTaskAction(LinkApplicationAndroidResourcesTask.java:269) at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:106) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73) at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:50) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:124) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328) at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:113) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:95) ... 33 more Caused by: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed Output: W:\android-studio-projects\sharedid\app\src\main\res\drawable\layerlist_micratingstars.xml:3: warn: generated id 'android:id/background' for external package 'android'. W:\android-studio-projects\sharedid\app\src\main\res\drawable\layerlist_micratingstars.xml:5: warn: generated id 'android:id/progress' for external package 'android'. W:\android-studio-projects\sharedid\app\src\main\res\drawable\layerlist_micratingstars.xml:4: warn: generated id 'android:id/secondaryProgress' for external package 'android'. W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v26\values-v26.xml:7: error: resource android:attr/colorError not found. W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v26\values-v26.xml:11: error: resource android:attr/colorError not found. W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v26\values-v26.xml:15: error: style attribute 'android:attr/keyboardNavigationCluster' not found. W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found. W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found. W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:235: error: resource android:attr/fontStyle not found. W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:235: error: resource android:attr/font not found. W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:235: error: resource android:attr/fontWeight not found. W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:235: error: resource android:attr/fontVariationSettings not found. W:\android-studio-projects\sharedid\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:235: error: resource android:attr/ttcIndex not found. error: failed linking references.
Command: C:\Users\%UserName%.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-alpha11-4662957-windows.jar\fc4f56a13b0b656fb51bcc296aa62bd7\aapt2-3.2.0-alpha11-4662957-windows\aapt2.exe link -I\ D:\Java-Android-SDK\platforms\android-25\android.jar\ --manifest\ W:\android-studio-projects\sharedid\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\ -o\ W:\android-studio-projects\sharedid\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\ -R\ @W:\android-studio-projects\sharedid\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\ --auto-add-overlay\ --java\ W:\android-studio-projects\sharedid\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\ --custom-package\ com.example.company.app\ -0\ apk\ --output-text-symbols\ W:\android-studio-projects\sharedid\app\build\intermediates\symbols\debug\R.txt\ --no-version-vectors Daemon: AAPT2 aapt2-3.2.0-alpha11-4662957-windows Daemon #0 at com.android.builder.internal.aapt.v2.Aapt2DaemonImpl.doLink(Aapt2DaemonImpl.kt:177) at com.android.builder.internal.aapt.v2.Aapt2Daemon.link(Aapt2Daemon.kt:103) at com.android.builder.internal.aapt.v2.Aapt2DaemonManager$LeasedAaptDaemon.link(Aapt2DaemonManager.kt:176) at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:811) at com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask.invokeAaptForSplit(LinkApplicationAndroidResourcesTask.java:517) ... 50 more
build.gradle
文件中的一些元素。为了帮助你,请编辑你的问题并附上这两个文件。(位于你的项目文件夹和应用程序文件夹中)。 - xiaomi