Java 错误:未找到属性'com.example.b3rk4.myapplication:layout\u constraintTop\u toTopOf'

Java 错误:未找到属性'com.example.b3rk4.myapplication:layout\u constraintTop\u toTopOf',java,android,gradle,Java,Android,Gradle,当我第一次打开Android Studio时,我看到AAPT2错误:检查日志以了解此错误的详细信息。 当我查看详细信息时,我写道: 错误:属性 myapplication:Layou_constraintBottom_toBottomOf' 没有找到 错误:属性 'com.example.b3rk4.myapplication:layout_constraintLeft_toLeftOf'不是 找到了 错误:属性 'com.example.b3rk4.myapplication:layout_c

当我第一次打开Android Studio时,我看到AAPT2错误:检查日志以了解此错误的详细信息。 当我查看详细信息时,我写道:

错误:属性 myapplication:Layou_constraintBottom_toBottomOf' 没有找到

错误:属性 'com.example.b3rk4.myapplication:layout_constraintLeft_toLeftOf'不是 找到了

错误:属性 'com.example.b3rk4.myapplication:layout_constraintRight_toRightOf'不是 找到了

错误:属性 'com.example.b3rk4.myapplication:layou constraintTop\u toTopOf'不是 找到了

Java编译器:1错误:链接文件资源失败

我已经试过了:

与管理员一起打开

生成->清理项目和生成->重建项目

使缓存无效/重新启动

执行此AAPT2错误时,在gradle.properties中添加android.enableAPT2=false:检查日志以了解详细信息转换为进程“command”时出错C:\Users\b3rk4\AppData\Local\android\Sdk\build tools\27.0.2\aapt.exe以非零退出值1完成,查看详细信息时:

未找到属性的资源标识符 包中的“layout_constraintBottom_toBottomOf” 'com.example.b3rk4.myapplication'

未找到属性的资源标识符 包中的“布局”\u constraintLeft\u toLeftOf” 'com.example.b3rk4.myapplication'

未找到属性的资源标识符 软件包中的“布局约束权” 'com.example.b3rk4.myapplication'

未找到属性的资源标识符 包装中的“布局约束图” 'com.example.b3rk4.myapplication'

Java编译器:3个错误

原因:java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:执行时出错 过程 C:\Users\b3rk4\AppData\Local\Android\Sdk\build tools\27.0.2\aapt.exe 带参数{package-f-no crunch-I C:\Users\b3rk4\AppData\Local\Android\Sdk\platforms\Android-27\Android.jar -M\?\C:\Users\b3rk4\Desktop\MyApplication\app\build\intermediates\manifests\full\debug\AndroidManifest.xml -S C:\Users\b3rk4\Desktop\MyApplication\app\build\intermediates\res\merged\debug -m-J\?\C:\Users\b3rk4\Desktop\MyApplication\app\build\generated\source\r\debug -F C:\Users\b3rk4\Desktop\MyApplication\app\build\intermediates\res\debug\resources-debug.ap_ -自定义包com.example.b3rk4.myapplication-0 apk-首选密度420dpi-输出文本符号\?\C:\Users\b3rk4\Desktop\myapplication\app\build\intermediates\symbols\debug -没有版本向量}

原因:com.android.ide.common.process.ProcessException:错误 在执行进程时 C:\Users\b3rk4\AppData\Local\Android\Sdk\build tools\27.0.2\aapt.exe 带参数{package-f-no crunch-I C:\Users\b3rk4\AppData\Local\Android\Sdk\platforms\Android-27\Android.jar -M\?\C:\Users\b3rk4\Desktop\MyApplication\app\build\intermediates\manifests\full\debug\AndroidManifest.xml -S C:\Users\b3rk4\Desktop\MyApplication\app\build\intermediates\res\merged\debug -m-J\?\C:\Users\b3rk4\Desktop\MyApplication\app\build\generated\source\r\debug -F C:\Users\b3rk4\Desktop\MyApplication\app\build\intermediates\res\debug\resources-debug.ap_ -自定义包com.example.b3rk4.myapplication-0 apk-首选密度420dpi-输出文本符号\?\C:\Users\b3rk4\Desktop\myapplication\app\build\intermediates\symbols\debug -没有版本向量}

原因:org.gradle.process.internal.ExecException:process'命令 'C:\Users\b3rk4\AppData\Local\Android\Sdk\build tools\27.0.2\aapt.exe 以非零退出值1结束

更改为classpath'com.android.tools.build:gradle:3.0.0'

更改为BuildToolsVersion27.0.2

我安装了javajdk,androidstudio,Sdk想得很仔细

添加路径C:\Users\b3rk4\AppData\Local\Android\Sdk\platform tools和C:\Users\b3rk4\AppData\Local\Android\Sdk

我未安装everythink并再次小心安装,注意不要更改

你能帮我吗?一个月前我正常使用Android Studio,我格式化了我的电脑,然后我就不能再使用了

我的build.gradle项目:

My build.gradle模块:应用程序:


在build.gradle中是否存在约束Layout依赖关系?我在主题中添加了“你能看一下并对我说吗?”当你对约束布局库没有依赖关系时会发生这种情况,但如果你发布的内容是正确的,看起来你已经拥有了它。有可能是缓存错误,由于通过Studio使缓存无效不起作用,请尝试在您的计算机上细化gradle缓存目录,然后删除整个内容。在windows上,它应该位于类似C:\Users\\.gradleI的位置。我用工作文件更改了.android、.AndroidStudio3.1、.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.0.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
}
apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.2"
    defaultConfig {
        applicationId "com.example.b3rk4.myapplication"
        minSdkVersion 15
        targetSdkVersion 27
        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:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    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'
}