"No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android"錯誤的解決

今天由於項目需求的原因,在網上找到一個3年前的demo,需要打開看一下,打開這個工程後,編譯提示"No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android"
在這裏插入圖片描述
再論壇裏也找到了解決辦法,就是下載舊版的NDK,將其中的toolchain複製到新版的NDK中

但這不是解決的根本辦法,總不能老是保留老版本吧

經過對新版NDK的文檔,發現NDK的更新記錄裏有一段話

This version of the NDK is incompatible with the Android Gradle plugin
version 3.0 or older. If you see an error like
No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android,
update your project file to [use plugin version 3.1 or newer]. You will also
need to upgrade to Android Studio 3.1 or newer.
也就是說新版本的NDK與3.0及以前舊版的Android Gradle plugin插件不兼容

其實解決方法很簡單,就是修改build.gradle中的加粗部分,改爲3.1以上版本即可

dependencies {
   		   classpath 'com.android.tools.build:gradle:**3.2.0**'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

至此,問題解決

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章