skip to Main Content

I am trying to generate APK but i run into an Obstacle, I am getting this As error :

> Task :react-native-gesture-handler:generateReleaseRFile FAILED

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':react-native-gesture-handler:generateReleaseRFile'.
> Could not resolve all files for configuration ':react-native-gesture-handler:releaseCompileClasspath'.
   > Failed to transform react-native-0.71.0-rc.0-release.aar (com.facebook.react:react-native:0.71.0-rc.0) to match attributes {artifactType=android-symbol-with-package-name, com.android.build.api.attributes.BuildTypeAttr=release, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-api}.
      > Could not find react-native-0.71.0-rc.0-release.aar (com.facebook.react:react-native:0.71.0-rc.0).
        Searched in the following locations:
            https://repo.maven.apache.org/maven2/com/facebook/react/react-native/0.71.0-rc.0/react-native-0.71.0-rc.0-release.aar

* 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:
java.lang.StackOverflowError (no error message)

* 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.
==============================================================================

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings

Execution optimizations have been disabled for 1 invalid unit(s) of work during this build to ensure correctness.
Please consult deprecation warnings for more details.

BUILD FAILED in 2m 8s
62 actionable tasks: 4 executed, 58 up-to-date

What would I not be doing rightly?

Other errors include

info Writing bundle output to:, D:react-native******androidappbuildgeneratedassetsreactreleaseindex.android.bundle
info Writing sourcemap output to:, D:react-native******androidappbuildintermediatessourcemapsreactreleaseindex.android.bundle.packager.map
info Done writing bundle output
info Done writing sourcemap output
info Copying 13 asset files
info Done copying assets
D:react-native******androidappbuildgeneratedassetsreactreleaseindex.android.bundle:1769:18: warning: the variable "DebuggerInternal" was not declared in function "__shouldPauseOnThrow"
          typeof DebuggerInternal !== 'undefined' && DebuggerInternal.shouldPauseOnThrow === true
                 ^~~~~~~~~~~~~~~~
D:react-native******androidappbuildgeneratedassetsreactreleaseindex.android.bundle:4994:7: warning: the variable "setTimeout" was not declared in function "logCapturedError"
      setTimeout(function () {
      ^~~~~~~~~~
D:react-native******androidappbuildgeneratedassetsreactreleaseindex.android.bundle:3592:21: warning: the variable "clearTimeout" was not declared in anonymous function " 90#"
    cancelTimeout = clearTimeout;
                    ^~~~~~~~~~~~
D:react-native******androidappbuildgeneratedassetsreactreleaseindex.android.bundle:7492:30: warning: the variable "__REACT_DEVTOOLS_GLOBAL_HOOK__" was not declared in anonymous function " 90#"
  if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:react-native******androidappbuildgeneratedassetsreactreleaseindex.android.bundle:7507:146: warning: the variable "nativeFabricUIManager" was not declared in anonymous function " 119#"
    null != handle._nativeTag && (null != handle._internalInstanceHandle ? (handle = handle._internalInstanceHandle.stateNode, null != handle && nativeFabricUIManager.dispatchCommand(handle.node, command, args)) : _$$_REQUIRE(_dependencyMap[2]).UIManager.dispatchViewManagerCommand(handle._nativeTag, command, args));
                                                                                                                                                 ^~~~~~~~~~~~~~~~~~~~~
D:react-native******androidappbuildgeneratedassetsreactreleaseindex.android.bundle:8324:5: warning: the variable "setImmediate" was not declared in function "handleResolved"
    setImmediate(function () {
    ^~~~~~~~~~~~
D:react-native******androidappbuildgeneratedassetsreactreleaseindex.android.bundle:8540:16: warning: the variable "AggregateError" was not declared in function "getAggregateError"
    if (typeof AggregateError === 'function') {
               ^~~~~~~~~~~~~~
D:react-native******androidappbuildgeneratedassetsreactreleaseindex.android.bundle:11456:12: warning: the variable "fetch" was not declared in anonymous function " 294#"
    fetch: fetch,
           ^~~~~
D:react-native******androidappbuildgeneratedassetsreactreleaseindex.android.bundle:11457:14: warning: the variable "Headers" was not declared in anonymous function " 294#"
    Headers: Headers,
             ^~~~~~~
D:react-native******androidappbuildgeneratedassetsreactreleaseindex.android.bundle:11458:14: warning: the variable "Request" was not declared in anonymous function " 294#"
    Request: Request,
             ^~~~~~~
D:react-native******androidappbuildgeneratedassetsreactreleaseindex.android.bundle:11459:15: warning: the variable "Response" was not declared in anonymous function " 294#"
    Response: Response
              ^~~~~~~~
D:react-native******androidappbuildgeneratedassetsreactreleaseindex.android.bundle:11608:24: warning: the variable "FileReader" was not declared in function "readBlobAsArrayBuffer"
      var reader = new FileReader();
                       ^~~~~~~~~~
D:react-native******androidappbuildgeneratedassetsreactreleaseindex.android.bundle:11645:36: warning: the variable "Blob" was not declared in anonymous function " 305#"
        } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
                                   ^~~~
D:react-native******androidappbuildgeneratedassetsreactreleaseindex.android.bundle:11647:40: warning: the variable "FormData" was not declared in anonymous function " 305#"
        } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
                                       ^~~~~~~~
D:react-native******androidappbuildgeneratedassetsreactreleaseindex.android.bundle:11649:44: warning: the variable "URLSearchParams" was not declared in anonymous function " 305#"
        } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
                                           ^~~~~~~~~~~~~~~
D:react-native******androidappbuildgeneratedassetsreactreleaseindex.android.bundle:11877:23: warning: the variable "XMLHttpRequest" was not declared in anonymous function " 314#"
        var xhr = new XMLHttpRequest();
                      ^~~~~~~~~~~~~~
D:react-native******androidappbuildgeneratedassetsreactreleaseindex.android.bundle:11468:76: warning: the variable "self" was not declared in anonymous function " 297#"
    var global = typeof globalThis !== 'undefined' && globalThis || typeof self !== 'undefined' && self || typeof global !== 'undefined' && global;
                                                                           ^~~~
D:react-native******androidappbuildgeneratedassetsreactreleaseindex.android.bundle:19082:27: warning: the variable "performance" was not declared in anonymous function " 498#"
  if ("object" === typeof performance && "function" === typeof performance.now) {
                          ^~~~~~~~~~~
D:react-native******androidappbuildgeneratedassetsreactreleaseindex.android.bundle:19105:26: warning: the variable "navigator" was not declared in anonymous function " 498#"
  "undefined" !== typeof navigator && undefined !== navigator.scheduling && undefined !== navigator.scheduling.isInputPending && navigator.scheduling.isInputPending.bind(navigator.scheduling);
                         ^~~~~~~~~
D:react-native******androidappbuildgeneratedassetsreactreleaseindex.android.bundle:19172:37: warning: the variable "MessageChannel" was not declared in anonymous function " 498#"
  };else if ("undefined" !== typeof MessageChannel) {
                                    ^~~~~~~~~~~~~~
D:react-native******androidappbuildgeneratedassetsreactreleaseindex.android.bundle:26733:32: warning: the variable "requestAnimationFrame" was not declared in function "onUpdate"
        this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));
                               ^~~~~~~~~~~~~~~~~~~~~
D:react-native******androidappbuildgeneratedassetsreactreleaseindex.android.bundle:65200:7: warning: the property "alignItems" was set multiple times in the object definition.
      alignItems: 'center',
      ^~~~~~~~~~~~~~~~~~~~
D:react-native******androidappbuildgeneratedassetsreactreleaseindex.android.bundle:65199:7: note: The first definition was here.
      alignItems: 'flex-start',
      ^~~~~~~~~~~~~~~~~~~~~~~~
D:react-native******androidappbuildgeneratedassetsreactreleaseindex.android.bundle:65242:7: warning: the property "alignItems" was set multiple times in the object definition.
      alignItems: 'center',
      ^~~~~~~~~~~~~~~~~~~~
D:react-native******androidappbuildgeneratedassetsreactreleaseindex.android.bundle:65241:7: note: The first definition was here.
      alignItems: 'flex-end',
      ^~~~~~~~~~~~~~~~~~~~~~

Been searching out different things on the Internet, could not find anything that solves the issue. Seems React native has changed some things i do not seem to see why its giving this As an error.

2

Answers


  1. android/build.gradle

    comment this line

     maven {
                url("$rootDir/../node_modules/react-native/android")
            }
    

    add

      exclusiveContent {
    
               filter {
                   includeGroup "com.facebook.react"
               }
    
               forRepository {
    
                   maven {
                       url "$rootDir/../node_modules/react-native/android"
                   }
    
               }
    
           }
    
            mavenLocal()
    
    Login or Signup to reply.
  2. add these lines into android/build.gradle File

    allprojects {
        repositories {
            google()
    
             exclusiveContent {
               filter {
                   includeGroup "com.facebook.react"
               }
               forRepository {
                   maven {
                       url "$rootDir/../node_modules/react-native/android"
                   }
               }
           }
           
           }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search