title: Android build error: Detected multiple Kotlin daemon sessions at build/kotlin/sessions
body: <p>I am following React Native <code>0.67.4</code> <a href="https://reactnative.dev/docs/signed-apk-android" rel="nofollow noreferrer">instruction</a> to generate keys and sign config before building release package. The app runs fine in Android emulator (Android Studio <code>2120.1.1 Patch2</code>). But when building release package, both <code>./gradlew assembleRelease</code> and <code>./gradlew bundleRelease</code> has the same error as below:</p>
  <blockquote>
  <p>Task :app:signReleaseBundle FAILED</p>
  </blockquote>
  <pre><code>w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':app:signReleaseBundle'.
  &gt; A failure occurred while executing com.android.build.gradle.internal.tasks.FinalizeBundleTask$BundleToolRunnable
     &gt; java.lang.NullPointerException (no error message)
  </code></pre>
  <p>Tried the following in the <a href="https://stackoverflow.com/questions/67135414/w-detected-multiple-kotlin-daemon-sessions-at-build-kotlin-sessions">post:</a></p>
  <ol>
  <li>Deleted all under ./gradle and <code>yarn run android</code></li>
  <li>./gradlew clean many times</li>
  </ol>
  <p>Android studio <code>2021.1.1 Patch2</code>, Gradle React Native plugin version  <code>7.2.1/(gradle 7.4.1)</code>.</p>
  <p>Here is part of <code>package.json</code>:</p>
  <pre><code>&quot;dependencies&quot;: {
      &quot;@ethersproject/shims&quot;: &quot;^5.6.0&quot;,
      &quot;@react-native-community/toolbar-android&quot;: &quot;^0.2.1&quot;,
      &quot;@react-native-masked-view/masked-view&quot;: &quot;^0.2.6&quot;,
      &quot;@react-native-picker/picker&quot;: &quot;^2.4.0&quot;,
      &quot;@react-navigation/native&quot;: &quot;^6.0.8&quot;,
      &quot;@react-navigation/stack&quot;: &quot;^6.1.1&quot;,
      &quot;crypto-js&quot;: &quot;^4.1.1&quot;,
      &quot;ethers&quot;: &quot;^5.6.1&quot;,
      &quot;react&quot;: &quot;17.0.2&quot;,
      &quot;react-native&quot;: &quot;0.67.4&quot;,
      &quot;react-native-blob-util&quot;: &quot;^0.14.1&quot;,
      &quot;react-native-confirmation-code-field&quot;: &quot;^7.3.0&quot;,
      &quot;react-native-device-info&quot;: &quot;^8.5.1&quot;,
      &quot;react-native-easy-grid&quot;: &quot;^0.2.2&quot;,
      &quot;react-native-elements&quot;: &quot;^3.4.2&quot;,
      &quot;react-native-encrypted-storage&quot;: &quot;^4.0.2&quot;,
      &quot;react-native-flash-message&quot;: &quot;^0.2.1&quot;,
      &quot;react-native-gesture-handler&quot;: &quot;^2.3.2&quot;,
      &quot;react-native-get-random-values&quot;: &quot;^1.7.2&quot;,
      &quot;react-native-gifted-chat&quot;: &quot;^0.16.3&quot;,
      &quot;react-native-image-picker&quot;: &quot;^4.7.3&quot;,
      &quot;react-native-loading-spinner-overlay&quot;: &quot;^3.0.0&quot;,
      &quot;react-native-modal&quot;: &quot;^13.0.1&quot;,
      &quot;react-native-reanimated&quot;: &quot;^2.5.0&quot;,
      &quot;react-native-redash&quot;: &quot;^16.2.3&quot;,
      &quot;react-native-responsive-screen&quot;: &quot;^1.4.2&quot;,
      &quot;react-native-safe-area-context&quot;: &quot;^4.2.2&quot;,
      &quot;react-native-screens&quot;: &quot;^3.13.1&quot;,
      &quot;react-native-vector-icons&quot;: &quot;^9.1.0&quot;,
      &quot;rn-alioss&quot;: &quot;^0.2.5&quot;,
      &quot;socket.io-client&quot;: &quot;^4.4.1&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;@babel/core&quot;: &quot;^7.12.9&quot;,
      &quot;@babel/runtime&quot;: &quot;^7.12.5&quot;,
      &quot;@react-native-community/eslint-config&quot;: &quot;^2.0.0&quot;,
      &quot;babel-jest&quot;: &quot;^26.6.3&quot;,
      &quot;eslint&quot;: &quot;7.14.0&quot;,
      &quot;jest&quot;: &quot;^26.6.3&quot;,
      &quot;metro-react-native-babel-preset&quot;: &quot;^0.66.2&quot;,
      &quot;react-test-renderer&quot;: &quot;17.0.2&quot;
    },
  </code></pre>