android studio run按钮为灰色
文鏈:解決"No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android"錯(cuò)誤;
今天安裝了Android Studio 3.2,打開(kāi)一個(gè)舊工程,android studio run按鈕為灰色;
1.按鈕顯示灰色......
旁邊的選擇框下拉后也沒(méi)有看見(jiàn)APP選項(xiàng)
百度了很多方法沒(méi)有解決,最后發(fā)現(xiàn),點(diǎn)擊sync project with gradle files按鈕(如下圖)同步一下;
?
2.出現(xiàn):No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android
網(wǎng)上也有解決辦法,就是下載舊版的NDK,將其中的toolchain復(fù)制到新版的NDK中
但是感覺(jué)這種方式,不是解決的正道。
經(jīng)過(guò)對(duì)新版NDK的研究,發(fā)現(xiàn)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.
也就是說(shuō)新版本的NDK與3.0及以前舊版的Android Gradle plugin插件不兼容
其實(shí)解決方法很簡(jiǎn)單,就是修改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
}
?
3.然后進(jìn)行一些列的工作
Minimum supported Gradle version is 4.6. Current version is 4.1.
Please fix the project's Gradle settings.
Fix Gradle wrapper and re-import project
Gradle settings
?
4.TFLite的程序按鈕綠了,可以運(yùn)行成功!
總結(jié)
以上是生活随笔為你收集整理的android studio run按钮为灰色的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 智能手机+DIY红外=万能遥控器
- 下一篇: Android:在安卓中使用TFLite