【问题标题】:':app:processDebugResources'. error in Android Studio 3.1':app:processDebugResources'。 Android Studio 3.1 中的错误
【发布时间】:2018-08-13 11:42:41
【问题描述】:

我不知道究竟是什么导致了这个错误,但我到处搜索,没有什么能解决它,它变得更糟了!当我构建我的应用程序时,它显示 AAPT2 错误:检查日志以了解详细信息。看截图。

我的项目 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.3'
       // classpath 'com.android.tools.build:gradle:3.2.0-alpha13'

        // classpath 'com.android.tools.build:gradle:3.1.4'
        //classpath 'com.android.tools.build:gradle:3.2.0-alpha11'
      // 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 文件

// 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.3'
       // classpath 'com.android.tools.build:gradle:3.2.0-alpha13'

        // classpath 'com.android.tools.build:gradle:3.1.4'
        //classpath 'com.android.tools.build:gradle:3.2.0-alpha11'
      // 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
}

我的论文正在进行中,这给我带来了一个很大的问题。请帮帮我!

【问题讨论】:

    标签: android-studio


    【解决方案1】:

    在你的 gradle.properties 文件中添加这一行

    android.enableAapt2=true

    【讨论】:

    • 请设置 android.enableAapt2=false 而不是 android.enableAapt2=true。
    • WARNING: The option 'android.enableAapt2' is deprecated and should not be used anymore.
    • 欢迎黛比! :)
    【解决方案2】:

    看看错误是什么 - 在您附加的第二张图片中,有 3 个 Android 问题(左侧窗口中的最后三个问题)。他们说某些 3 个属性有问题。如果您单击它们,您将能够看到整个错误,然后修复问题。

    【讨论】:

    • error: style attribute 'attr/colorPrimary (aka com.example.owner.foodal11_2:attr/colorPrimary)' not found. Message{kind=ERROR, text=error: style attribute 'attr/colorPrimary (aka com.example.owner.foodal11_2:attr/colorPrimary)' not found., sources=[C:\Users\Owner\.gradle\caches\transforms-1\files-1.1\support-compat-26.1.0.aar\2743de8bfcf56b2faf350423b91d3d0a\res\values\values.xml:49:5-117], original message=, tool name=Optional.of(AAPT)} 它试图从 values.xml 中删除 android 标签,因为它是红色的,类似错误,但是当我重建时出现相同的错误。
    • 我将 compile 和 targetSdk 更改为 27 并将 support:appcompat 更改为 27.0.1 但现在我有这个错误Program type already present: org.jsoup.Connection$Request Message{kind=ERROR, text=Program type already present: org.jsoup.Connection$Request, sources=[Unknown source file], tool name=Optional.of(D8)}
    【解决方案3】:

    跟踪错误 尝试在您的项目目录中运行以下命令

    gradlew assembleDebug

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-09-08
      • 1970-01-01
      • 2019-01-23
      • 2023-03-27
      • 1970-01-01
      • 2023-03-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多