简体   繁体   English

Android Studio在哪里读取构建工具版本?

[英]Where is Android Studio reading the build tools version?

I'm getting the error: 我收到错误消息:

WARN - ect.sync.idea.ProjectSetUpTask - Failed to find Build Tools revision 26.0.2 警告-ect.sync.idea.ProjectSetUpTask-无法找到构建工具修订版26.0.2

It is actually an error breaking my build but this wasn't copyable so I found this line in the log (the only place I could find reference to "26.0.2" 这实际上是一个错误,破坏了我的版本,但这是不可复制的,因此我在日志中找到了这一行(我唯一可以找到对“ 26.0.2”的引用)

I've searched (Ctrl-Shift-F) for 26.0.2 everywhere and found just 2 occurrences of 26 in one file, the "app" level build.gradle: 我到处搜索(Ctrl-Shift-F)26.0.2,发现在一个文件“ app”级别build.gradle中只有2次出现26。

android {
    compileSdkVersion 26
    defaultConfig {
        targetSdkVersion 26
...

Which I changed to 27, my build tools is 27.0.3 which I use for other projects, I don't want another build tools. 其中我变为27,我的构建工具是27.0.3,我用其他项目,我不希望再构建工具。 How can I communicate this to Android Studio? 如何将其传达给Android Studio?

无法安装构建工具

Credit to https://stackoverflow.com/a/47425748/866333 , I hope this offers easier sign posting: 归功于https://stackoverflow.com/a/47425748/866333 ,我希望这可以简化招牌发布:

android {
    compileSdkVersion 27
    // Add the following line, Android Studio is quite good for filtering bloat.
    buildToolsVersion "27.0.3"
    defaultConfig {
        targetSdkVersion 27
        ...

I actually had to add a line, so I don't know where AS was reading 26.0.2 from, but this fix has worked on 2 of my projects. 我实际上必须添加一行,所以我不知道AS从哪里读取26.0.2,但是此修复程序已经在我的2个项目中起作用。 Oh, and because I'm now using the support lib (because its 2018): 哦,因为我现在正在使用支持库(因为其2018年):

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:support-v4:26.1.0'
    implementation 'com.android.support:design:26.1.0'

will be on the wrong versions, fix by replacing the 3 occurrences of "26.1.0" with, eg, "27.1.1", as that was what the error messages was hinting at. 会使用错误的版本,请通过用“ 27.1.1”替换3个出现的“ 26.1.0”来解决,因为这就是错误消息所暗示的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android Studio构建工具和Gradle版本兼容性 - Android Studio build tools and gradle version compatibility 如何在Android Studio中更改构建工具版本 - How to change build tools version in Android Studio How to check Android SDK version, Android Build Tools version and Android Support Repository version in Android studio? - How to check Android SDK version, Android Build Tools version and Android Support Repository version in Android studio? 我可以在Android Studio中使用过时版本的SDK构建工具吗? - Can I use obsolete version of SDK build tools in android studio? 升级构建工具版本android studio有哪些优缺点 - What advantages and disadvantages of upgrading build tools version android studio 升级的Android Studio - Project不再构建gradle构建工具版本 - Upgraded Android Studio - Project no longer builds gradle build tools version Android Studio构建工具安装 - android studio build tools install 无法使用 Android Studio 中的构建工具 29 解析 Build.VERSION_CODES.Q - Cannot resolve Build.VERSION_CODES.Q with build tools 29 in Android Studio 如何更改Android Studio / Gradle中所有模块的构建工具版本号? - How to change the build tools version number for all of my modules in Android Studio/Gradle? 如何设置Android Studio项目中所需的最低SDK Build Tools版本? - How to set the minimum SDK Build Tools version required in an Android Studio project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM