title: Android Studio: Releasing signed Bundle with native c++ Code just runs forever
body: <p>I have an Android app that I want to release. I recently added a native c++ library and testing on the device worked fine. However, when I want to make a new release, I run into the following problem:
  Generating Signed Bundle will just run forever without any error messages. This is the console output:</p>
  <pre><code>&gt; Task :app:externalNativeBuildRelease
  Build native-lib_armeabi-v7a
  ninja: Entering directory `/Users/haenles/Development/private/myapp/app/.cxx/cmake/release/armeabi-v7a'
  
  &gt; Task :app:externalNativeBuildRelease
  [1/2] Building CXX object CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o
  [2/2] Linking CXX shared library ../../../../build/intermediates/cmake/release/obj/armeabi-v7a/libnative-lib.so
  Build native-lib_arm64-v8a
  ninja: Entering directory `/Users/haenles/Development/private/myapp/app/.cxx/cmake/release/arm64-v8a'
  </code></pre>
  <p>This is a screenshot of the &quot;ongoing&quot; Build:
  <a href="https://i.stack.imgur.com/hR0IT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hR0IT.png" alt="enter image description here" /></a></p>
  <p>My build.gradle looks like this:</p>
  <pre><code>android {
      compileSdkVersion 30
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
      kotlinOptions {
          jvmTarget = &quot;1.8&quot;
      }
      defaultConfig {
          applicationId &quot;com.my.packagename&quot;
          minSdkVersion 21
          targetSdkVersion 30
          versionCode 23
          versionName &quot;2.2&quot;
          testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
          resConfigs &quot;en&quot;, &quot;de&quot;, &quot;pt&quot;
      }
      buildTypes {
          release {
              minifyEnabled true
              shrinkResources true
              proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
          }
          debug {
              minifyEnabled false
              shrinkResources false
          }
      }
      viewBinding {
          enabled = true
      }
      testOptions {
          unitTests.returnDefaultValues = true
      }
      externalNativeBuild {
          cmake {
              path &quot;CMakeLists.txt&quot;
          }
      }
  }
  </code></pre>
  <p>The CmakeLists.txt looks like this:</p>
  <pre><code>cmake_minimum_required(VERSION 3.4.1)
  
  add_library( # Sets the name of the library.
               native-lib
  
               # Sets the library as a shared library.
               SHARED
  
               # Provides a relative path to your source file(s).
               src/main/cpp/native-lib.cpp )
  
  find_library( # Sets the name of the path variable.
                log-lib
  
                # Specifies the name of the NDK library that
                # you want CMake to locate.
                log )
  
  
  target_link_libraries( # Specifies the target library.
                         native-lib
  
                         # Links the target library to the log library
                         # included in the NDK.
                         ${log-lib} )
  
  </code></pre>
  <p>Screensot of my project setup:</p>
  <p><a href="https://i.stack.imgur.com/EQ0Tj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EQ0Tj.png" alt="enter image description here" /></a></p>
  <p>I am using the latest Android Studio version, the latest gradle-wrapper and gradle version. I have already tried &quot;Invalidate Caches and restart&quot; and &quot;Refresh linked c++ Projects&quot;. I am running Android Studio on Mac Os Catalina.
  Does anyone have a clue what could be wrong here? This occurs only when I want to release a signed bundle. Building to a device just works fine.</p>
  <p>To me it looks like the ninja is not able to build the arm64-v8a for some reason. Do I need additional configuration maybe?</p>
  <p>Cheers,
  Sym</p>