0

Everything is perfect at simulator but when I am trying to build a signed released build apk, I am getting this error:

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

I am clueless as this is first time happening. below is the debug log:

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.
Haren Sarma
  • 2,267
  • 6
  • 43
  • 72
  • have you found the solution? – Sunny Jun 20 '22 at 11:25
  • The question is answered in another thread: https://stackoverflow.com/questions/60878599/error-building-android-library-direct-local-aar-file-dependencies-are-not-supp – sgupta Dec 13 '22 at 23:55

1 Answers1

-2

I have faced same issue,i tried with add module but not working so i changed my build tools gradle dependency version from 4.2.2 to 3.6.1 and this solution is working with if add .aar file in libs folder because gradle tools version more than 4.0.0 is not supported local .aar files.

classpath 'com.android.tools.build:gradle:3.6.1'