模拟器的一切都很完美,但是当我尝试构建已签名的已发布构建apk时,出现此错误:
Direct local .aar file dependencies are not supported when building an AAR. The resulting AAR would be broken because the classes and Android resources from any local .aar file dependencies would not be packaged in the resulting AAR. Previous versions of the Android Gradle Plugin produce broken AARs in this case too (despite not throwing this error). The following direct local .aar file dependencies of the :react-native-reanimated project caused this error: /Users/fullmad/Projects/dollse-cab/dollseCab/node_modules/react-native-reanimated/android/react-native-reanimated-67-hermes.aar
我很无能为力,因为这是第一次发生。下面是调试日志:
2022-02-25T21:54:11.231+0530 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :react-native-reanimated:bundleReleaseLocalLintAar FAILED
2022-02-25T21:54:11.231+0530 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter] Putting task artifact state for task ':react-native-reanimated:bundleReleaseLocalLintAar' into context took 0.0 secs.
2022-02-25T21:54:11.232+0530 [INFO] [org.gradle.api.internal.file.collections.DirectoryFileTree] file or directory '/Users/fullmad/Projects/dollse-cab/dollseCab/node_modules/react-native-reanimated/android/build/intermediates/merged_consumer_proguard_file/release/proguard.txt', not found
2022-02-25T21:54:11.232+0530 [DEBUG] [org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep] Implementation for task ':react-native-reanimated:bundleReleaseLocalLintAar': com.android.build.gradle.tasks.BundleAar_Decorated@6391213d196b913250dceb15fea0e08a
2022-02-25T21:54:11.232+0530 [DEBUG] [org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep] Additional implementations for task ':react-native-reanimated:bundleReleaseLocalLintAar': [com.android.build.gradle.tasks.BundleAar_Decorated@470bed4de8e56733bd153e760e2c35a4]
2022-02-25T21:54:11.233+0530 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Snapshot inputs and outputs before executing task ':react-native-reanimated:bundleReleaseLocalLintAar'' completed
2022-02-25T21:54:11.233+0530 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter] Removed task artifact state for task ':react-native-reanimated:bundleReleaseLocalLintAar' from context.
2022-02-25T21:54:11.238+0530 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Task :react-native-reanimated:bundleReleaseLocalLintAar'
2022-02-25T21:54:11.239+0530 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Task :react-native-reanimated:bundleReleaseLocalLintAar' completed
2022-02-25T21:54:11.238+0530 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 5395: dispatching BuildEvent[event=org.gradle.internal.build.event.types.DefaultTaskFinishedProgressEvent@59695dd2]
2022-02-25T21:54:11.239+0530 [INFO] [org.gradle.execution.plan.DefaultPlanExecutor] :react-native-reanimated:bundleReleaseLocalLintAar (Thread[Daemon worker Thread 8,5,main]) completed. Took 0.008 secs.
2022-02-25T21:54:11.239+0530 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :react-native-reanimated:bundleReleaseLocalLintAar failed
2022-02-25T21:54:11.239+0530 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :react-native-reanimated:bundleReleaseLocalLintAar completed, executed: true
2022-02-25T21:54:11.239+0530 [DEBUG] [org.gradle.execution.plan.Node] Checking if all dependencies are complete for ExtractAarTransform
2022-02-25T21:54:11.239+0530 [DEBUG] [org.gradle.execution.plan.Node] All dependencies are complete for ExtractAarTransform
2022-02-25T21:54:11.239+0530 [DEBUG] [org.gradle.execution.plan.Node] Checking if all dependencies are complete for ExtractAarTransform
2022-02-25T21:54:11.239+0530 [DEBUG] [org.gradle.execution.plan.Node] All dependencies are complete for ExtractAarTransform
2022-02-25T21:54:11.239+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker Thread 8: released lock on :
2022-02-25T21:54:11.239+0530 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.265 completed (1 worker(s) in use)
2022-02-25T21:54:11.239+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker Thread 8: released lock on root.1.265
2022-02-25T21:54:11.240+0530 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.265 started (1 worker(s) in use).
2022-02-25T21:54:11.240+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker Thread 8: acquired lock on root.1.265
2022-02-25T21:54:11.240+0530 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node ExtractAarTransform completed, executed: false
2022-02-25T21:54:11.240+0530 [DEBUG] [org.gradle.execution.plan.Node] Checking if all dependencies are complete for :app:lintVitalAnalyzeRelease
2022-02-25T21:54:11.240+0530 [DEBUG] [org.gradle.execution.plan.Node] Dependency ExtractAarTransform for :app:lintVitalAnalyzeRelease not yet completed
2022-02-25T21:54:11.240+0530 [DEBUG] [org.gradle.execution.plan.Node] Checking if all dependencies are complete for :app:lintVitalRelease
2022-02-25T21:54:11.240+0530 [DEBUG] [org.gradle.execution.plan.Node] Dependency ExtractAarTransform for :app:lintVitalRelease not yet completed
2022-02-25T21:54:11.240+0530 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Already completed node ExtractAarTransform reported as finished executing
2022-02-25T21:54:11.240+0530 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.265 completed (1 worker(s) in use)
2022-02-25T21:54:11.240+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker Thread 8: released lock on root.1.265
2022-02-25T21:54:11.241+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker Thread 8: acquired lock on :
2022-02-25T21:54:11.241+0530 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.265 started (1 worker(s) in use).
2022-02-25T21:54:11.241+0530 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker Thread 8: acquired lock on root.1.265
2022-02-25T21:54:11.241+0530 [INFO] [org.gradle.execution.plan.DefaultPlanExecutor] :react-native-safe-area-context:mergeReleaseJniLibFolders (Thread[Daemon worker Thread 8,5,main]) started.
2022-02-25T21:54:11.241+0530 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Task :react-native-safe-area-context:mergeReleaseJniLibFolders' started
2022-02-25T21:54:11.242+0530 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Snapshot inputs and outputs before executing task ':react-native-safe-area-context:mergeReleaseJniLibFolders'' started
2022-02-25T21:54:11.241+0530 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 5395: dispatching BuildEvent[event=org.gradle.internal.build.event.types.DefaultTaskStartedProgressEvent@153975f6]
2022-02-25T21:54:11.243+0530 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Snapshot inputs and outputs before executing task ':react-native-safe-area-context:mergeReleaseJniLibFolders''
2022-02-25T21:54:11.241+0530 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger]
Execution failed for task ':react-native-reanimated:bundleReleaseLocalLintAar'.
> Error while evaluating property 'hasLocalAarDeps' of task ':react-native-reanimated:bundleReleaseLocalLintAar'
> Direct local .aar file dependencies are not supported when building an AAR. The resulting AAR would be broken because the classes and Android resources from any local .aar file dependencies would not be packaged in the resulting AAR. Previous versions of the Android Gradle Plugin produce broken AARs in this case too (despite not throwing this error). The following direct local .aar file dependencies of the :react-native-reanimated project caused this error: /Users/fullmad/Projects/dollse-cab/dollseCab/node_modules/react-native-reanimated/android/react-native-reanimated-67-hermes.aar
* Try:
Run with --stacktrace option to get the stack trace. Run with --scan to get full insights.
我遇到了同样的问题,我尝试添加模块,但不起作用,所以我将构建工具gradle依赖版本从4.2.2更改为3.6.1,此解决方案正在使用libs文件夹中的add. aar文件,因为gradle工具版本超过4.0.0不支持本地. aar文件。
类路径' com . Android . tools . build:gradle:3 . 6 . 1 '