Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR]: Please help me, how can I modify it to support buildTypes in buildSrc? My needs are as follows. I don't know much about gradle. #1565

Open
2 tasks done
TsaiYongChuan opened this issue Aug 8, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@TsaiYongChuan
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the problem

Many signature files are configured in the original project. Signatures are distinguished by buildtypes. When debugging, many corresponding configuration items can be seen, and debugging can be performed quickly on different devices.
image
image
image

Describe the solution

In the new project, multiple modules are used. In order to make all modules share this configuration, I imitated the project code of https://github.com/android/nowinandroid and configured it using buildSrc. Currently, the corresponding buildTypes appear in Android studio, but it cannot be run.
image
image
image
image

Additional context

The build was successful, but an error message will be displayed when running!
image
`Executing tasks: [:midtest:assembleMidtestH0871] in project C:\yongchuan\apex\intelligent_inspection_factory

Task :xc_build:xcbuild:checkKotlinGradlePluginConfigurationErrors
Task :xc_build:xcbuild:compileKotlin UP-TO-DATE
Task :xc_build:xcbuild:compileJava NO-SOURCE
Task :xc_build:xcbuild:pluginDescriptors UP-TO-DATE
Task :xc_build:xcbuild:processResources UP-TO-DATE
Task :xc_build:xcbuild:classes UP-TO-DATE
Task :xc_build:xcbuild:jar UP-TO-DATE

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine the dependencies of task ':midtest:lintVitalReportMidtestH0871'.

Could not resolve all task dependencies for configuration ':midtest:midtestH0871CompileClasspath'.
Could not resolve project :xc_apex_base.
Required by:
project :midtest
> No matching variant of project :xc_apex_base was found. The consumer was configured to find a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.4.0', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'h0871', attribute 'com.android.build.api.attributes.ProductFlavor:xcApexIIF' with value 'midtest', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
- Variant 'debugApiElements' declares a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.4.0', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm':
- Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'h0871'
- Other compatible attribute:
- Doesn't say anything about com.android.build.api.attributes.ProductFlavor:xcApexIIF (required 'midtest')
- Variant 'debugRuntimeElements' declares a library for use during runtime, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.4.0', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm':
- Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'h0871'
- Other compatible attribute:
- Doesn't say anything about com.android.build.api.attributes.ProductFlavor:xcApexIIF (required 'midtest')
- Variant 'debugSourcesElements' declares a component for use during runtime, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.4.0', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm':
- Incompatible because this component declares documentation, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a library, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'h0871'
- Other compatible attribute:
- Doesn't say anything about com.android.build.api.attributes.ProductFlavor:xcApexIIF (required 'midtest')
- Variant 'releaseApiElements' declares a library for use during compile-time, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.4.0', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm':
- Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'h0871'
- Other compatible attribute:
- Doesn't say anything about com.android.build.api.attributes.ProductFlavor:xcApexIIF (required 'midtest')
- Variant 'releaseRuntimeElements' declares a library for use during runtime, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.4.0', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm':
- Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'h0871'
- Other compatible attribute:
- Doesn't say anything about com.android.build.api.attributes.ProductFlavor:xcApexIIF (required 'midtest')
- Variant 'releaseSourcesElements' declares a component for use during runtime, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.4.0', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm':
- Incompatible because this component declares documentation, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a library, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'h0871'
- Other compatible attribute:
- Doesn't say anything about com.android.build.api.attributes.ProductFlavor:xcApexIIF (required 'midtest')

  • Try:

Review the variant matching algorithm at https://docs.gradle.org/8.7/userguide/variant_attributes.html#sec:abm_algorithm.
No matching variant errors are explained in more detail at https://docs.gradle.org/8.7/userguide/variant_model.html#sub:variant-no-match.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.

  • Exception is:
    org.gradle.api.internal.tasks.TaskDependencyResolveException: Could not determine the dependencies of task ':midtest:lintVitalReportMidtestH0871'.
    at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.getDependencies(CachingTaskDependencyResolveContext.java:68)
    at org.gradle.execution.plan.TaskDependencyResolver.resolveDependenciesFor(TaskDependencyResolver.java:49)
    at org.gradle.execution.plan.LocalTaskNode.getDependencies(LocalTaskNode.java:148)
    at org.gradle.execution.plan.LocalTaskNode.resolveDependencies(LocalTaskNode.java:122)
    at org.gradle.execution.plan.DefaultExecutionPlan.discoverNodeRelationships(DefaultExecutionPlan.java:182)
    at org.gradle.execution.plan.DefaultExecutionPlan.doAddEntryNodes(DefaultExecutionPlan.java:154)
    at org.gradle.execution.plan.DefaultExecutionPlan.addEntryTasks(DefaultExecutionPlan.java:129)
    at org.gradle.execution.plan.DefaultExecutionPlan.addEntryTasks(DefaultExecutionPlan.java:121)
    at org.gradle.execution.TaskNameResolvingBuildTaskScheduler.scheduleRequestedTasks(TaskNameResolvingBuildTaskScheduler.java:54)
    at org.gradle.execution.DefaultTasksBuildTaskScheduler.scheduleRequestedTasks(DefaultTasksBuildTaskScheduler.java:72)
    at org.gradle.initialization.DefaultTaskExecutionPreparer.lambda$scheduleRequestedTasks$0(DefaultTaskExecutionPreparer.java:46)
    at org.gradle.internal.Factories$1.create(Factories.java:31)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withReplacedLocks(DefaultWorkerLeaseService.java:360)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$DefaultBuildProjectRegistry.withMutableStateOfAllProjects(DefaultProjectStateRegistry.java:240)
    at org.gradle.api.internal.project.DefaultProjectStateRegistry$DefaultBuildProjectRegistry.withMutableStateOfAllProjects(DefaultProjectStateRegistry.java:233)
    at org.gradle.initialization.DefaultTaskExecutionPreparer.scheduleRequestedTasks(DefaultTaskExecutionPreparer.java:45)
    at org.gradle.initialization.VintageBuildModelController.lambda$scheduleRequestedTasks$0(VintageBuildModelController.java:76)
    at org.gradle.internal.model.StateTransitionController.lambda$inState$1(StateTransitionController.java:99)
    at org.gradle.internal.model.StateTransitionController.lambda$inState$2(StateTransitionController.java:114)
    at org.gradle.internal.work.DefaultSynchronizer.withLock(DefaultSynchronizer.java:44)
    at org.gradle.internal.model.StateTransitionController.inState(StateTransitionController.java:110)
    at org.gradle.internal.model.StateTransitionController.inState(StateTransitionController.java:98)
    at org.gradle.initialization.VintageBuildModelController.scheduleRequestedTasks(VintageBuildModelController.java:76)
    at org.gradle.internal.build.DefaultBuildLifecycleController$DefaultWorkGraphBuilder.addRequestedTasks(DefaultBuildLifecycleController.java:404)
    at org.gradle.internal.buildtree.DefaultBuildTreeWorkPreparer.lambda$scheduleRequestedTasks$0(DefaultBuildTreeWorkPreparer.java:41)
    at org.gradle.internal.build.DefaultBuildLifecycleController.lambda$populateWorkGraph$7(DefaultBuildLifecycleController.java:189)
    at org.gradle.internal.build.DefaultBuildWorkPreparer.populateWorkGraph(DefaultBuildWorkPreparer.java:42)
    at org.gradle.internal.build.BuildOperationFiringBuildWorkPreparer$PopulateWorkGraph.populateTaskGraph(BuildOperationFiringBuildWorkPreparer.java:106)
    at org.gradle.internal.build.BuildOperationFiringBuildWorkPreparer$PopulateWorkGraph.run(BuildOperationFiringBuildWorkPreparer.java:92)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
    at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
    at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
    at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
    at org.gradle.internal.build.BuildOperationFiringBuildWorkPreparer.populateWorkGraph(BuildOperationFiringBuildWorkPreparer.java:67)
    at org.gradle.internal.build.DefaultBuildLifecycleController.lambda$populateWorkGraph$8(DefaultBuildLifecycleController.java:189)
    at org.gradle.internal.model.StateTransitionController.lambda$inState$1(StateTransitionController.java:99)
    at org.gradle.internal.model.StateTransitionController.lambda$inState$2(StateTransitionController.java:114)
    at org.gradle.internal.work.DefaultSynchronizer.withLock(DefaultSynchronizer.java:44)
    at org.gradle.internal.model.StateTransitionController.inState(StateTransitionController.java:110)
    at org.gradle.internal.model.StateTransitionController.inState(StateTransitionController.java:98)
    at org.gradle.internal.build.DefaultBuildLifecycleController.populateWorkGraph(DefaultBuildLifecycleController.java:189)
    at org.gradle.internal.build.DefaultBuildWorkGraphController$DefaultBuildWorkGraph.populateWorkGraph(DefaultBuildWorkGraphController.java:169)
    at org.gradle.composite.internal.DefaultBuildController.populateWorkGraph(DefaultBuildController.java:76)
    at org.gradle.composite.internal.DefaultIncludedBuildTaskGraph$DefaultBuildTreeWorkGraphBuilder.withWorkGraph(DefaultIncludedBuildTaskGraph.java:153)
    at org.gradle.internal.buildtree.DefaultBuildTreeWorkPreparer.lambda$scheduleRequestedTasks$1(DefaultBuildTreeWorkPreparer.java:41)
    ...

BUILD FAILED in 1s
5 actionable tasks: 1 executed, 4 up-to-date
XC XcSigning size 7XC XcSigning storeFile`

Code of Conduct

  • I agree to follow this project's Code of Conduct
@TsaiYongChuan TsaiYongChuan added the enhancement New feature or request label Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant