如何设置Android Studio项目中所需的最低SDK Build Tools版本? [英] How to set the minimum SDK Build Tools version required in an Android Studio project?

查看:181
本文介绍了如何设置Android Studio项目中所需的最低SDK Build Tools版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在Android模拟器中运行我的React Native项目时,出现以下错误:

When I try to run my React Native project in the Android emulator I get the following error:

对于项目':app'而言,SDK Build Tools修订版(23.0.1)太低.最低要求为25.0.0

The SDK Build Tools revision (23.0.1) is too low for project ':app'. Minimum required is 25.0.0

我的 android/app/build.gradle 文件指定:

buildToolsVersion "23.0.1"

在Android Studio上,它还会为我使用的每个程序包记录相同的错误:

On Android Studio, it also logs the same error for each of the packages I'm using:

我认为这是在我无意中更新了Android Studio建议的某些内容之后开始发生的.

I believe this started happening after I inadvertently updated some stuff that Android Studio suggested.

我检查过的所有 build.gradle 文件都指定版本 23.0.1 ,但是由于某些原因, 25.0.0 似乎覆盖该设置.

All the build.gradle files that I've checked specify version 23.0.1, but for some reason 25.0.0 seems to be overriding that setting.

我该如何解决这个问题?

How do I go about correcting this?

推荐答案

遇到此问题,并意识到该错误非常模糊.从iOS背景到React Native,我不得不学习更多有关Android生态系统的知识.问题是您的项目Gradle版本太高.

Ran into this issue and realized that the error is quite vague. Coming from an iOS background into React Native, I've had to learn a lot more about the Android ecosystem. The problem is that your project Gradle version is too high.

在项目的(顶级) build.gradle 中,您可能正在使用:

In your project's (top level) build.gradle you may be using:

classpath'com.android.tools.build:gradle:2.3.1'

版本v2.3.1中,将最低的SDK Build Tools修订版隐式设置为25.0.0.

Gradle v2.3.1, implicitly sets the minimum SDK Build Tools revision to 25.0.0.

要解决此问题,您可以简单地恢复为:

To fix, you can simply revert back to:

classpath'com.android.tools.build:gradle:2.2.3'

这将允许您项目的模块使用buildToolsVersions 23.0.1 25.0.2

This will allow your project's modules to use buildToolsVersions 23.0.1 or 25.0.2

这篇关于如何设置Android Studio项目中所需的最低SDK Build Tools版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆