我是 IntelliJ 和 Android 开发的新手。我的问题是,当我尝试构建一个 gradle 项目时,它失败并抛出错误代码 B0。我已经将我的 Gradle 版本更新到 5.1.1,但错误仍然存在build.gradle 文件:// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.1.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }}allprojects { repositories { google() jcenter() }}task clean(type: Delete) { delete rootProject.buildDir}app 模块中的 build.gradle 文件:apply plugin: 'com.android.application'android { compileSdkVersion 26 defaultConfig { applicationId "com.example.jose.myapplication" minSdkVersion 23 targetSdkVersion 26 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } }}dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:26.1.0' implementation 'com.android.support.constraint:constraint-layout:1.1.3' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'}有人知道修复吗?谢谢和对不起我的英语!
1 回答

慕盖茨4494581
TA贡献1850条经验 获得超11个赞
固定的!!我只是将 gradle 版本从 5.1.1 降级到 4.13 并安装了 Android SDK 构建工具 27.0.3。谢谢您的帮助。
添加回答
举报
0/150
提交
取消