title: Unknown host CPU architecture: arm64 , Android NDK SiliconM1 Apple MacBook Pro
body: <p>I've got a project that is working fine in windows os but when I switched my laptop and opened an existing project in <strong>MacBook Pro M1</strong>. I'm unable to run an existing android project in <strong>MacBook pro M1</strong>. first I was getting</p>
  <blockquote>
  <p>Execution failed for task ':app:kaptDevDebugKotlin'. &gt; A failure
  occurred while executing
  org.jetbrains.kotlin.gradle.internal.KaptExecution    &gt;
  java.lang.reflect.InvocationTargetException (no error message)</p>
  </blockquote>
  <p>this error was due to the Room database I applied a fix that was adding below library before Room database and also <strong>changed my JDK location from file structure from JRE to JDK.</strong></p>
  <blockquote>
  <p>kapt &quot;org.xerial:sqlite-jdbc:3.34.0&quot;</p>
  </blockquote>
  <pre><code>   //Room components
      kapt &quot;org.xerial:sqlite-jdbc:3.34.0&quot;
      implementation &quot;androidx.room:room-ktx:$rootProject.roomVersion&quot;
      kapt &quot;androidx.room:room-compiler:$rootProject.roomVersion&quot;
      androidTestImplementation &quot;androidx.room:room-testing:$rootProject.roomVersion&quot;
  </code></pre>
  <p>after that now I'm getting an issue which is <strong>Unknown host CPU architecture: arm64</strong></p>
  <p>there is an SDK in my project that is using this below line.</p>
  <pre><code>android {
      externalNativeBuild {
          ndkBuild {
             path 'Android.mk'
          }
      }
      ndkVersion '21.4.7075529'
  
  
  }
  </code></pre>
  <p><strong>App Gradle</strong></p>
  <pre><code> externalNativeBuild {
          cmake {
              path &quot;src/main/cpp/CMakeLists.txt&quot;
              version &quot;3.18.1&quot;
              //version &quot;3.10.2&quot;
          }
      }
  </code></pre>
  <blockquote>
  <p>[CXX1405] error when building with ndkBuild using
  /Users/mac/Desktop/Consumer-Android/ime/dictionaries/jnidictionaryv2/Android.mk:
  Build command failed. Error while executing process
  /Users/mac/Library/Android/sdk/ndk/21.4.7075529/ndk-build with
  arguments {NDK_PROJECT_PATH=null
  APP_BUILD_SCRIPT=/Users/mac/Desktop/Consumer-Android/ime/dictionaries/jnidictionaryv2/Android.mk
  APP_ABI=arm64-v8a NDK_ALL_ABIS=arm64-v8a NDK_DEBUG=1
  APP_PLATFORM=android-21
  NDK_OUT=/Users/mac/Desktop/Consumer-Android/ime/dictionaries/jnidictionaryv2/build/intermediates/cxx/Debug/4k4s2lc6/obj
  NDK_LIBS_OUT=/Users/mac/Desktop/Consumer-Android/ime/dictionaries/jnidictionaryv2/build/intermediates/cxx/Debug/4k4s2lc6/lib
  APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n} ERROR:
  Unknown host CPU architecture: arm64</p>
  </blockquote>
  <p>which is causing this issue and whenever I comment on this line</p>
  <blockquote>
  <p>path 'Android.mk'</p>
  </blockquote>
  <p>it starts working fine, is there any way around which will help me run this project with this piece of code without getting this NDK issue?</p>
  <p><strong>Update</strong> - It seems that Room got fixed in the latest updates, Therefore you may consider updating Room to the latest version <strong>(2.3.0-alpha01 / 2.4.0-alpha03 or above)</strong></p>
  <p><strong>use ndkVersion &quot;24.0.8215888&quot; update ndk to this version and no need to edit any script :)</strong></p>
  <p><a href="https://github.com/AnySoftKeyboard/AnySoftKeyboard/issues/3026" rel="noreferrer">GitHub Issue Tracker</a></p>