android-studio - 运行颤振应用程序时android studio中的gradle错误
问题描述
我正在尝试使用 firebase 验证我的登录页面活动。所以,在这样做的时候我得到了这个 Gradle 错误。
我参考了下面的链接,但对我没有任何作用。
在 project/android/app/build.Gradle 中,GradleException 以红色突出显示。
build.gradle 文件:
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.google.gms:google-services:4.3.3'
classpath 'com.android.tools.build:gradle:4.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
在控制台中,错误是:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:stripDebugDebugSymbols'.
> No version of NDK matched the requested version 21.0.6113669. Versions available locally: 20.1.5948944
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 40s
Exception: Gradle task assembleDebug failed with exit code 1
帮我解决这个问题。
解决方案
您必须通过Project settings -> SDK Location -> Android NDK location配置您的 NDK 。
如果您没有 NDK,则需要转到工具 -> SDK 管理器 -> SDK 工具选项卡,然后选择 NDK(并排)并安装它。
推荐阅读
- java - 将 java spring-boot app *.jar 与根文件夹中的其他文件一起部署到 heroku
- firebase - 在每个屏幕中获取当前 Firebase 用户的正确方法是什么?
- android - Android ViewModel 参考 Fragment
- r - 阶乘后有多少个尾随零?
- python - python中的链接方法出错
- python - 如何使用python中的函数连续扩展列表?
- git - 需要紧急 Git 帮助 - 丢失了大多数提交
- python - 是否需要关闭文件才能用python编写?
- python - 在不使用 sklearn 的情况下计算混淆矩阵
- sql - 有没有办法显示每周丢失多少本书?