title: Android React Native app crashes after splash screen when built with App Center
body: <p>As the title says, we are struggling to produce a working release version of our app using our normal pipeline in App Center.
  When I build the app via command line using the release flags locally, there is no problem with the output APK.</p>
  <p>And likewise when the build runs on app center, there is nothing to suggest a problem with the build either, except once installed and ran, the app crashes immediately after the splash screen.</p>
  <p>We recently upgraded to gradle 7.3.3 and as a result had to upgrade to JAVA 11 for this, and likewise add the environment key <code>JAVA_HOME : $(JAVA_HOME_11_X64)</code> to our environment variables on App Center.</p>
  <p>Has anyone else encountered this.</p>
  <p>The biggest issue is that without being able to replicate this in a locally produced release build, we can't work out how to debug the problem, the app center produced release build has no error logging whatsoever. It silently crashes.</p>
  <p>The only concerning part of the app center logs appear to be as below.</p>
  <p>EDIT: To make things more interesting, I added <code>debuggable true</code> to the release config of build.gradle, and that build ran fine.... don't know what that so drastically changed</p>
  <pre><code>info Writing bundle output to:, /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle
  info Writing sourcemap output to:, /Users/runner/work/1/s/android/app/build/intermediates/sourcemaps/react/release/index.android.bundle.packager.map
  info Done writing bundle output
  info Done writing sourcemap output
  info Copying 201 asset files
  info Done copying assets
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:3242:23: warning: the variable &quot;DebuggerInternal&quot; was not declared in function &quot;__shouldPauseOnThrow&quot;
          return typeof DebuggerInternal !== 'undefined' &amp;&amp; DebuggerInternal.shouldPauseOnThrow === true;
                        ^~~~~~~~~~~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:6950:7: warning: the variable &quot;setTimeout&quot; was not declared in function &quot;logCapturedError&quot;
        setTimeout(function () {
        ^~~~~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:5337:23: warning: the variable &quot;clearTimeout&quot; was not declared in anonymous function &quot; 153#&quot;
        cancelTimeout = clearTimeout;
                        ^~~~~~~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:9717:30: warning: the variable &quot;__REACT_DEVTOOLS_GLOBAL_HOOK__&quot; was not declared in anonymous function &quot; 153#&quot;
    if (&quot;undefined&quot; !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:9735:68: warning: the variable &quot;nativeFabricUIManager&quot; was not declared in anonymous function &quot; 187#&quot;
      null != handle._nativeTag &amp;&amp; (handle._internalInstanceHandle ? nativeFabricUIManager.dispatchCommand(handle._internalInstanceHandle.stateNode.node, command, args) : _$$_REQUIRE(_dependencyMap[2]).UIManager.dispatchViewManagerCommand(handle._nativeTag, command, args));
                                                                     ^~~~~~~~~~~~~~~~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:10629:5: warning: the variable &quot;setImmediate&quot; was not declared in function &quot;handleResolved&quot;
      setImmediate(function () {
      ^~~~~~~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:14139:12: warning: the variable &quot;fetch&quot; was not declared in anonymous function &quot; 352#&quot;
      fetch: fetch,
             ^~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:14140:14: warning: the variable &quot;Headers&quot; was not declared in anonymous function &quot; 352#&quot;
      Headers: Headers,
               ^~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:14141:14: warning: the variable &quot;Request&quot; was not declared in anonymous function &quot; 352#&quot;
      Request: Request,
               ^~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:14142:15: warning: the variable &quot;Response&quot; was not declared in anonymous function &quot; 352#&quot;
      Response: Response
                ^~~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:14318:24: warning: the variable &quot;FileReader&quot; was not declared in function &quot;readBlobAsArrayBuffer&quot;
        var reader = new FileReader();
                         ^~~~~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:14363:36: warning: the variable &quot;Blob&quot; was not declared in anonymous function &quot; 363#&quot;
          } else if (support.blob &amp;&amp; Blob.prototype.isPrototypeOf(body)) {
                                     ^~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:14365:40: warning: the variable &quot;FormData&quot; was not declared in anonymous function &quot; 363#&quot;
          } else if (support.formData &amp;&amp; FormData.prototype.isPrototypeOf(body)) {
                                         ^~~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:14367:44: warning: the variable &quot;URLSearchParams&quot; was not declared in anonymous function &quot; 363#&quot;
          } else if (support.searchParams &amp;&amp; URLSearchParams.prototype.isPrototypeOf(body)) {
                                             ^~~~~~~~~~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:14644:23: warning: the variable &quot;XMLHttpRequest&quot; was not declared in anonymous function &quot; 372#&quot;
          var xhr = new XMLHttpRequest();
                        ^~~~~~~~~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:14151:76: warning: the variable &quot;self&quot; was not declared in anonymous function &quot; 355#&quot;
      var global = typeof globalThis !== 'undefined' &amp;&amp; globalThis || typeof self !== 'undefined' &amp;&amp; self || typeof global !== 'undefined' &amp;&amp; global;
                                                                             ^~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:19151:27: warning: the variable &quot;performance&quot; was not declared in anonymous function &quot; 522#&quot;
    if (&quot;object&quot; === typeof performance &amp;&amp; &quot;function&quot; === typeof performance.now) {
                            ^~~~~~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:19166:62: warning: the variable &quot;MessageChannel&quot; was not declared in anonymous function &quot; 522#&quot;
    if (&quot;undefined&quot; === typeof window || &quot;function&quot; !== typeof MessageChannel) {
                                                               ^~~~~~~~~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:24720:32: warning: the variable &quot;requestAnimationFrame&quot; was not declared in function &quot;onUpdate&quot;
          this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));
                                 ^~~~~~~~~~~~~~~~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:61349:16: warning: the variable &quot;Intl&quot; was not declared in function &quot;intlFormat&quot;
      return new Intl.DateTimeFormat((_localeOptions = localeOptions) === null || _localeOptions === undefined ? undefined : _localeOptions.locale, formatOptions).format(date);
                 ^~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:75869:16: warning: the variable &quot;navigator&quot; was not declared in function &quot;isStandardBrowserEnv&quot;
      if (typeof navigator !== 'undefined' &amp;&amp; (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {
                 ^~~~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:76189:51: warning: the variable &quot;btoa&quot; was not declared in function &quot;dispatchXhrRequest&quot;
          requestHeaders.Authorization = 'Basic ' + btoa(***name + ':' + password);
                                                    ^~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:77621:32: warning: the variable &quot;AggregateError&quot; was not declared in anonymous function &quot; 2057#&quot;
      '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
                                 ^~~~~~~~~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:77630:25: warning: the variable &quot;Atomics&quot; was not declared in anonymous function &quot; 2057#&quot;
      '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
                          ^~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:77631:24: warning: the variable &quot;BigInt&quot; was not declared in anonymous function &quot; 2057#&quot;
      '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
                         ^~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:77644:38: warning: the variable &quot;FinalizationRegistry&quot; was not declared in anonymous function &quot; 2057#&quot;
      '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
                                       ^~~~~~~~~~~~~~~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:77669:35: warning: the variable &quot;SharedArrayBuffer&quot; was not declared in anonymous function &quot; 2057#&quot;
      '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
                                    ^~~~~~~~~~~~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:77683:25: warning: the variable &quot;WeakRef&quot; was not declared in anonymous function &quot; 2057#&quot;
      '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
                          ^~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:142236:41: warning: the variable &quot;getComputedStyle&quot; was not declared in function &quot;generateLayersText&quot;
          var computedFontSize = parseInt(getComputedStyle(node).fontSize, 10);
                                          ^~~~~~~~~~~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:140522:18: warning: the variable &quot;MutationObserver&quot; was not declared in anonymous function &quot; 3601#&quot;
        if (typeof MutationObserver !== 'undefined') _MUTATION_OBSERVER = MutationObserver;
                   ^~~~~~~~~~~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:171057:32: warning: the variable &quot;crypto&quot; was not declared in function &quot;rng&quot;
        getRandomValues = typeof crypto !== 'undefined' &amp;&amp; crypto.getRandomValues &amp;&amp; crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' &amp;&amp; typeof msCrypto.getRandomValues === 'function' &amp;&amp; msCrypto.getRandomValues.bind(msCrypto);
                                 ^~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:171057:130: warning: the variable &quot;msCrypto&quot; was not declared in function &quot;rng&quot;
        getRandomValues = typeof crypto !== 'undefined' &amp;&amp; crypto.getRandomValues &amp;&amp; crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' &amp;&amp; typeof msCrypto.getRandomValues === 'function' &amp;&amp; msCrypto.getRandomValues.bind(msCrypto);
                                                                                                                                   ^~~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:225075:18: warning: Direct call to eval(), but lexical scope is not supported.
            return eval(&quot;(&quot;.concat(source, &quot;)&quot;));
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:225079:19: warning: Direct call to eval(), but lexical scope is not supported.
            var f = eval(&quot;(&quot;.concat(source, &quot;)&quot;));
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /Users/runner/work/1/s/android/app/build/generated/assets/react/release/index.android.bundle:227293:17: warning: the variable &quot;__fbBatchedBridge&quot; was not declared in function &quot;getHost&quot;
      if ((typeof __fbBatchedBridge === &quot;undefined&quot; ? &quot;undefined&quot; : _typeof(__fbBatchedBridge)) !== 'object' || hostname !== 'localhost' &amp;&amp; hostname !== '127.0.0.1') {
                  ^~~~~~~~~~~~~~~~~
  </code></pre>