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

Gradle sync failed with AGP 7.1.1 #1634

Open
HardFatal opened this issue Feb 17, 2022 · 15 comments
Open

Gradle sync failed with AGP 7.1.1 #1634

HardFatal opened this issue Feb 17, 2022 · 15 comments

Comments

@HardFatal
Copy link

AGP 升级到 7.0 以上gradle sync失败。

异常类型:编译异常
tinker版本:如: 1.9.14.18
gradle版本:如:7.2

  1. 升级tinker-sample-android中gradle相关版本
    tinker-sample-android/build.gradle
    classpath 'com.android.tools.build:gradle:3.5.3' 改为 classpath 'com.android.tools.build:gradle:7.1.1'

tinker-sample-android/gradle/wrapper/gradle-wrapper.properties
distributionUrl=https://services.gradle.org/distributions/gradle-6.1.1-all.zip 改为 distributionUrl=https://services.gradle.org/distributions/gradle-7.2-bin.zip

  1. 修改android AGP 7.0 不兼容的gradle配置
  2. 点击gradle sync
  3. sync 失败

Caused by: com.android.build.gradle.internal.dsl.AgpDslLockedException: It is too late to modify additionalParameters
It has already been read to configure this project.
Consider either moving this call to be during evaluation,
or using the variant API.
at com.android.build.gradle.internal.dsl.decorator.LockableList.add(LockableList.kt:83)
at com.android.build.gradle.internal.dsl.AaptOptions.additionalParameters(AaptOptions.java:166)
at com.android.build.api.dsl.AndroidResources$additionalParameters.call(Unknown Source)
at com.tencent.tinker.build.gradle.task.TinkerResourceIdTask.injectStableIdsFileOnDemand(TinkerResourceIdTask.groovy:90)
at com.tencent.tinker.build.gradle.task.TinkerResourceIdTask$injectStableIdsFileOnDemand.call(Unknown Source)
at com.tencent.tinker.build.gradle.TinkerPatchPlugin$_apply_closure1.doCall(TinkerPatchPlugin.groovy:132)

@nsacer
Copy link

nsacer commented Feb 18, 2022

AGP7.0在版本1.9.14.19才支持的。升级吧。

@cocpublic
Copy link

cocpublic commented Feb 18, 2022

1.9.14.19也不行,更新说明说是支持了AGP7、R8,实测并没有解决,除了这两个问题外还有一个Manifest钟tinkerid更新的问题

@nsacer
Copy link

nsacer commented Feb 18, 2022

1.9.14.19也不行,更新说明说是支持了AGP7、R8,实测并没有解决,除了这两个问题外还有一个Manifest钟tinkerid更新的问题

你新建项目接入试试,我已经成功接入了。

@cocpublic
Copy link

cocpublic commented Feb 18, 2022

AGP7.0在版本1.9.14.19才支持的。升级吧。

你接入1.9.14.19、Gradle 7.0后,开启固定资源ID,没有遇到too late to modify additionalParameter的问题吗?
看源码逻辑 可以手动在build.gradle中指定aaptOptions.additionalParameters可以临时解决,暂未验证

还有这个开启R8的问题,R8 outlining 与 Tinker 存在兼容性问题 ,AGP7强制开启R8,如果使用,暂时可以在混淆规则中禁用优化,可临时解决-dontoptimize

还有一个随机出现的TinkerId未更新的问题,没遇上吗 ,
tinkerProcessManifest任务修改的目录是processManifest的产物目录build/intermediates/merged_manifests,在这里追加tinkerId,agp4.1后在processManifest新增的processManifestForPackage,产物目录是build/intermediates/packaged_manifests ,如果processManifestForPackage执行的比tinkerProcessManifest快,最后打进apk的AndroidManifest.xml中tinkerid并不是最新的。
我看源码里面只是声明了 tinkerProcessManifest 在processManifest的后面执行,并没有声明与processManifestForPackage的时序。
目前我是新加了一些代码,让processManifestForPackage 在tinkerProcessManifest之后执行解决的。

这几个问题,我解决方案都比较挫,大佬你们都是咋处理的?

@huhuang03
Copy link

但是com.tencent.bugly.tinker-support。这个插件只支持AGP4。有没有办法使用AGP7呢。不用com.tencent.bugly.tinker-support而是使用com.tencent.tinker.patch吗。我想用bugly管理,不使用bugly提供的插件有影响吗

@cocpublic
Copy link

cocpublic commented Feb 22, 2022

参考tinker-support的代码逻辑,我们自实现了一套逻辑,无痕替换了tinker-support。上面提到的问题除了R8外,其他固定资源Id、TinkerId未更新等问题刚适配了。
关于R8,目前打算把minifyEnabled 改为false,禁用掉R8,单独使用proguard提供的插件进行混淆。https://www.guardsquare.com/blog/using-proguard-with-the-android-gradle-plugin

@huhuang03
Copy link

huhuang03 commented Feb 22, 2022

你们用bugly管理后台管理补丁包吗。tinker-support代码都没有开源啊。。你们反编译做的吗。这要不少的工作量吧。有点想弃坑,用sophix了。。。

@huhuang03
Copy link

huhuang03 commented Feb 25, 2022

我刚看到文档,原来生成MF文档 这里有介绍tinker-support的工作产出。按照这个写的吧。

@Aracoix
Copy link

Aracoix commented Mar 1, 2022

参考tinker-support的代码逻辑,我们自实现了一套逻辑,无痕替换了tinker-support。上面提到的问题除了R8外,其他固定资源Id、TinkerId未更新等问题刚适配了。 关于R8,目前打算把minifyEnabled 改为false,禁用掉R8,单独使用proguard提供的插件进行混淆。https://www.guardsquare.com/blog/using-proguard-with-the-android-gradle-plugin

老铁实现tinker-support有开源的么,不会写插件

@wxy2016
Copy link

wxy2016 commented Apr 18, 2022

FAILURE: Build completed with 3 failures.

1: Task failed with an exception.

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

  • Try:
    Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Exception is:
    org.gradle.internal.execution.WorkValidationException: A problem was found with the configuration of task ':app:chappieSupportProcessBuild_onlineDebugManifest' (type 'ChappieManifestTask').

    • Type 'com.jd.chappie.build.gradle.task.ChappieManifestTask' property 'manifestPath' is missing an input or output annotation.

      Reason: A property without annotation isn't considered during up-to-date checking.

      Possible solutions:

      1. Add an input or output annotation.
      2. Mark it as @internal.

      Please refer to https://docs.gradle.org/7.0.2/userguide/validation_problems.html#missing_annotation for more details about this problem.
      at org.gradle.internal.execution.WorkValidationException$BuilderWithSummary.build(WorkValidationException.java:109)
      at org.gradle.internal.execution.WorkValidationException$BuilderWithSummary.get(WorkValidationException.java:91)
      at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:97)
      at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:50)
      at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:86)
      at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:86)
      at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:32)
      at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
      at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:43)
      at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:31)
      at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:40)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution$2.withWorkspace(ExecuteActionsTaskExecuter.java:283)
      at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:40)
      at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30)
      at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37)
      at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27)
      at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:49)
      at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:35)
      at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:76)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:184)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:173)
      at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
      at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
      at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
      at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
      at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
      at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
      at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
      at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
      at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
      at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
      at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
      at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:74)
      at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:408)
      at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:395)
      at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:388)
      at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:374)
      at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
      at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
      at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
      at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
      at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
      at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
      at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)

==============================================================================

2: Task failed with an exception.

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

  • Try:
    Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Exception is:
    org.gradle.internal.execution.WorkValidationException: A problem was found with the configuration of task ':app:tinkerProcessBuild_onlineDebugManifest' (type 'TinkerManifestTask').

    • Type 'com.tencent.tinker.build.gradle.task.TinkerManifestTask' property 'outputNameToManifestMap' is missing an input or output annotation.

      Reason: A property without annotation isn't considered during up-to-date checking.

      Possible solutions:

      1. Add an input or output annotation.
      2. Mark it as @internal.

      Please refer to https://docs.gradle.org/7.0.2/userguide/validation_problems.html#missing_annotation for more details about this problem.
      at org.gradle.internal.execution.WorkValidationException$BuilderWithSummary.build(WorkValidationException.java:109)
      at org.gradle.internal.execution.WorkValidationException$BuilderWithSummary.get(WorkValidationException.java:91)
      at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:97)
      at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:50)
      at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:86)
      at java.base/java.util.Optional.orElseGet(Optional.java:369)
      at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:86)
      at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:32)
      at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
      at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:43)
      at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:31)
      at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:40)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution$2.withWorkspace(ExecuteActionsTaskExecuter.java:283)
      at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:40)
      at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30)
      at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37)
      at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27)
      at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:49)
      at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:35)
      at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:76)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:184)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:173)
      at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
      at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
      at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
      at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
      at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
      at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
      at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
      at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
      at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
      at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
      at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
      at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:74)
      at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:408)
      at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:395)
      at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:388)
      at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:374)
      at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
      at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
      at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
      at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
      at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
      at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
      at java.base/java.lang.Thread.run(Thread.java:834)

==============================================================================

3: Task failed with an exception.

  • What went wrong:
    Some problems were found with the configuration of task ':app:tinkerProcessBuild_onlineDebugResourceId' (type 'TinkerResourceIdTask').

  • Try:
    Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Exception is:
    org.gradle.internal.execution.WorkValidationException: Some problems were found with the configuration of task ':app:tinkerProcessBuild_onlineDebugResourceId' (type 'TinkerResourceIdTask').

    • Type 'com.tencent.tinker.build.gradle.task.TinkerResourceIdTask' property 'addPublicFlagForAapt2' is missing an input or output annotation.

      Reason: A property without annotation isn't considered during up-to-date checking.

      Possible solutions:

      1. Add an input or output annotation.
      2. Mark it as @internal.

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

    • Type 'com.tencent.tinker.build.gradle.task.TinkerResourceIdTask' property 'applicationId' is missing an input or output annotation.

      Reason: A property without annotation isn't considered during up-to-date checking.

      Possible solutions:

      1. Add an input or output annotation.
      2. Mark it as @internal.

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

    • Type 'com.tencent.tinker.build.gradle.task.TinkerResourceIdTask' property 'realNameMap' is missing an input or output annotation.

      Reason: A property without annotation isn't considered during up-to-date checking.

      Possible solutions:

      1. Add an input or output annotation.
      2. Mark it as @internal.

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

    • Type 'com.tencent.tinker.build.gradle.task.TinkerResourceIdTask' property 'resDir' is missing an input or output annotation.

      Reason: A property without annotation isn't considered during up-to-date checking.

      Possible solutions:

      1. Add an input or output annotation.
      2. Mark it as @internal.

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

    • Type 'com.tencent.tinker.build.gradle.task.TinkerResourceIdTask' property 'variantName' is missing an input or output annotation.

      Reason: A property without annotation isn't considered during up-to-date checking.

      Possible solutions:

      1. Add an input or output annotation.
      2. Mark it as @internal.

      Please refer to https://docs.gradle.org/7.0.2/userguide/validation_problems.html#missing_annotation for more details about this problem.
      at org.gradle.internal.execution.WorkValidationException$BuilderWithSummary.build(WorkValidationException.java:109)
      at org.gradle.internal.execution.WorkValidationException$BuilderWithSummary.get(WorkValidationException.java:91)
      at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:97)
      at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:50)
      at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:86)
      at java.base/java.util.Optional.orElseGet(Optional.java:369)
      at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:86)
      at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:32)
      at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
      at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:43)
      at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:31)
      at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:40)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution$2.withWorkspace(ExecuteActionsTaskExecuter.java:283)
      at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:40)
      at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30)
      at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37)
      at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27)
      at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:49)
      at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:35)
      at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:76)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:184)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:173)
      at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
      at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
      at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
      at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
      at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
      at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
      at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
      at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
      at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
      at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
      at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
      at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
      at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
      at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:74)
      at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:408)
      at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:395)
      at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:388)
      at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:374)
      at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
      at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
      at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
      at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
      at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
      at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
      at java.base/java.lang.Thread.run(Thread.java:834)

==============================================================================

@yanbober
Copy link
Contributor

1.9.14.19也不行,更新说明说是支持了AGP7、R8,实测并没有解决,除了这两个问题外还有一个Manifest钟tinkerid更新的问题

你新建项目接入试试,我已经成功接入了。

提交了 pr,官方一直没收录,解决 tinker id 不更新问题 #1550

@yanbober
Copy link
Contributor

AGP7.0在版本1.9.14.19才支持的。升级吧。

你接入1.9.14.19、Gradle 7.0后,开启固定资源ID,没有遇到too late to modify additionalParameter的问题吗? 看源码逻辑 可以手动在build.gradle中指定aaptOptions.additionalParameters可以临时解决,暂未验证

还有这个开启R8的问题,R8 outlining 与 Tinker 存在兼容性问题 ,AGP7强制开启R8,如果使用,暂时可以在混淆规则中禁用优化,可临时解决-dontoptimize

还有一个随机出现的TinkerId未更新的问题,没遇上吗 , tinkerProcessManifest任务修改的目录是processManifest的产物目录build/intermediates/merged_manifests,在这里追加tinkerId,agp4.1后在processManifest新增的processManifestForPackage,产物目录是build/intermediates/packaged_manifests ,如果processManifestForPackage执行的比tinkerProcessManifest快,最后打进apk的AndroidManifest.xml中tinkerid并不是最新的。 我看源码里面只是声明了 tinkerProcessManifest 在processManifest的后面执行,并没有声明与processManifestForPackage的时序。 目前我是新加了一些代码,让processManifestForPackage 在tinkerProcessManifest之后执行解决的。

这几个问题,我解决方案都比较挫,大佬你们都是咋处理的?

提交了 pr,官方一直没收录,解决 tinker id 不更新问题 #1550

@eric-lian
Copy link

问题是 ,你怎么保证 基础包和 patch包混淆一直那 ?

@eric-lian
Copy link

eric-lian commented Apr 29, 2022

我自己试了一下 , 如果开启混淆 ,只添加 -dontoptimize 生成的patch 很会很大 , 目前发现要想解决只能禁用混淆 , 添加 -dontobfuscate

@ysavr
Copy link

ysavr commented May 30, 2022

我自己试了一下 , 如果开启混淆 ,只添加 -dontoptimize 生成的patch 很会很大 , 目前发现要想解决只能禁用混淆 , 添加 -dontobfuscate

hallo, where do you add -dontoptimize and -dontobfuscate ?

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

No branches or pull requests

9 participants