Android Studio Mac M1 Silicon:Unknown host CPU architecture arm64

今天升级AS到M1版本,编译的时候遇到错误

Unknown host CPU architecture arm64

因为代码中用到了NDK,但是NDK目前还不支持arm64,解决方案

https://github.com/android/ndk/issues/1299

修改 ndk-build

Android Studio Mac M1 Silicon:Unknown host CPU architecture arm64

 Android Studio Mac M1 Silicon:Unknown host CPU architecture arm64

#!/bin/sh
# 原脚本
# DIR="$(cd "$(dirname "$0")" && pwd)"
# $DIR/build/ndk-build "$@"

# 新脚本
DIR="$(cd "$(dirname "$0")" && pwd)"
arch -x86_64 /bin/bash $DIR/build/ndk-build "$@

编译成功,看起来是个临时方案。

 

2021-06-08

上一篇:PHP获取当前请求IP


下一篇:RabbitMQ学习01--基本概念