Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

gradle 8.x 报错 #5

Closed
hmy65 opened this issue Mar 20, 2023 · 2 comments
Closed

gradle 8.x 报错 #5

hmy65 opened this issue Mar 20, 2023 · 2 comments

Comments

@hmy65
Copy link

hmy65 commented Mar 20, 2023

@Leon406 请大哥帮忙看看 跪谢
Executing tasks: [resguardRelease] in project C:\Users\pc1\Desktop\WorkSpace

Configure project :app
AGPBI: {"kind":"warning","text":"The option setting 'android.experimental.enableNewResourceShrinker.preciseShrinking=true' is experimental.\nThe current default is 'false'.","sources":[{}]}
AGPBI: {"kind":"warning","text":"The option setting 'android.enableResourceOptimizations=false' is deprecated.\nThe current default is 'true'.\nIt will be removed in version 8.0 of the Android Gradle plugin.","sources":[{}]}
Configuration 'kspReleaseKotlinProcessorClasspath' was resolved during configuration time.
This is a build performance and scalability issue.
See gradle/gradle#2298
Run with --info for a stacktrace.

Task :app:createReleaseVariantModel UP-TO-DATE
Task :app:buildKotlinToolingMetadata UP-TO-DATE
Task :app:preBuild UP-TO-DATE
Task :app:preReleaseBuild UP-TO-DATE
Task :app:compileReleaseAidl NO-SOURCE
Task :app:compileReleaseRenderscript NO-SOURCE
Task :app:dataBindingMergeDependencyArtifactsRelease UP-TO-DATE
Task :app:generateReleaseResValues UP-TO-DATE
Task :app:generateReleaseResources UP-TO-DATE
Task :app:commonStringReleaseResourceLocator UP-TO-DATE
Task :app:templateStringReleaseResourceLocator UP-TO-DATE
Task :app:templatesReleaseIdentifier UP-TO-DATE
Task :app:gatherReleaseStringTemplates UP-TO-DATE
Task :app:resolveReleasePlaceholders UP-TO-DATE
Task :app:mergeReleaseResources UP-TO-DATE
Task :app:packageReleaseResources UP-TO-DATE
Task :app:parseReleaseLocalResources UP-TO-DATE
Task :app:dataBindingGenBaseClassesRelease UP-TO-DATE
Task :app:generateReleaseBuildConfig UP-TO-DATE
Task :app:checkReleaseAarMetadata UP-TO-DATE
Task :app:mapReleaseSourceSetPaths FAILED
Task :app:createReleaseCompatibleScreenManifests UP-TO-DATE
Task :app:extractDeepLinksRelease FAILED
Task :app:javaPreCompileRelease UP-TO-DATE
Task :app:extractProguardFiles UP-TO-DATE
Task :app:mergeReleaseJniLibFolders UP-TO-DATE
Task :app:mergeReleaseNativeLibs NO-SOURCE
Task :app:stripReleaseDebugSymbols NO-SOURCE
Task :app:extractReleaseNativeSymbolTables NO-SOURCE
Task :app:mergeReleaseNativeDebugMetadata NO-SOURCE
Task :app:mergeReleaseArtProfile UP-TO-DATE
Task :app:checkReleaseDuplicateClasses UP-TO-DATE
Task :app:processReleaseJavaRes NO-SOURCE
Task :app:mergeReleaseShaders UP-TO-DATE
Task :app:compileReleaseShaders NO-SOURCE
Task :app:generateReleaseAssets UP-TO-DATE
Task :app:mergeReleaseAssets UP-TO-DATE
Task :app:compressReleaseAssets UP-TO-DATE
Task :app:collectReleaseDependencies UP-TO-DATE
Task :app:sdkReleaseDependencyData UP-TO-DATE
Task :app:validateSigningRelease UP-TO-DATE
Task :app:writeReleaseAppMetadata UP-TO-DATE
Task :app:writeReleaseSigningConfigVersions UP-TO-DATE

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • What went wrong:
    A problem was found with the configuration of task ':app:mapReleaseSourceSetPaths' (type 'MapSourceSetPathsTask').

    • Gradle detected a problem with the following location: 'C:\Users\pc1\Desktop\WorkSpace\app\build\generated\resolved\release'.

      Reason: Task ':app:mapReleaseSourceSetPaths' uses this output of task ':app:resolveReleasePlaceholders' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.

      Possible solutions:

      1. Declare task ':app:resolveReleasePlaceholders' as an input of ':app:mapReleaseSourceSetPaths'.
      2. Declare an explicit dependency on ':app:resolveReleasePlaceholders' from ':app:mapReleaseSourceSetPaths' using Task#dependsOn.
      3. Declare an explicit dependency on ':app:resolveReleasePlaceholders' from ':app:mapReleaseSourceSetPaths' using Task#mustRunAfter.

      Please refer to https://docs.gradle.org/8.0.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.

  • What went wrong:
    A problem was found with the configuration of task ':app:extractDeepLinksRelease' (type 'ExtractDeepLinksTask').

    • Gradle detected a problem with the following location: 'C:\Users\pc1\Desktop\WorkSpace\app\build\generated\resolved\release\navigation'.

      Reason: Task ':app:extractDeepLinksRelease' uses this output of task ':app:resolveReleasePlaceholders' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.

      Possible solutions:

      1. Declare task ':app:resolveReleasePlaceholders' as an input of ':app:extractDeepLinksRelease'.
      2. Declare an explicit dependency on ':app:resolveReleasePlaceholders' from ':app:extractDeepLinksRelease' using Task#dependsOn.
      3. Declare an explicit dependency on ':app:resolveReleasePlaceholders' from ':app:extractDeepLinksRelease' using Task#mustRunAfter.

      Please refer to https://docs.gradle.org/8.0.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================

BUILD FAILED in 519ms
31 actionable tasks: 2 executed, 29 up-to-date

@Leon406
Copy link
Owner

Leon406 commented Mar 20, 2023

非插件问题, 请自行解决, 提示已经很明确了

Reason: Task ':app:mapReleaseSourceSetPaths' uses this output of task ':app:resolveReleasePlaceholders' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.

Possible solutions:

Declare task ':app:resolveReleasePlaceholders' as an input of ':app:mapReleaseSourceSetPaths'.
Declare an explicit dependency on ':app:resolveReleasePlaceholders' from ':app:mapReleaseSourceSetPaths' using Task#dependsOn.
Declare an explicit dependency on ':app:resolveReleasePlaceholders' from ':app:mapReleaseSourceSetPaths' using Task#mustRunAfter.

@Leon406 Leon406 closed this as completed Mar 20, 2023
@hmy65
Copy link
Author

hmy65 commented Mar 20, 2023

@Leon406
感谢。解决了,需要在build.gradle加上这些

afterEvaluate {
def first = tasks.named('resolveReleasePlaceholders')
tasks.named('extractDeepLinksRelease') { dependsOn(first) }
tasks.named('mapReleaseSourceSetPaths') { dependsOn(first) }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants