android - 在新项目中以非零退出值 1 完成

标签 android gradle

我只是在 64 位系统上安装了所有 Android 设置,其中安装了 API 级别 21 和 19,每次当我尝试创建一个新项目(无论是 API 21 还是 19)时,每次设置后都失败且非零退出值

Error:Gradle: Execution failed for task ':app:processDebugResources'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files (x86)\Android\android-sdk\build-tools\23.0.0\aapt.exe'' finished with non-zero exit value 1



C:\Users\rahul\IdeaProjects\MyApplication\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.0.0\res\values-v21\values-v21.xml
Error:(1, -1) Gradle: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material'.
Error:(1, -1) Gradle: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body1'.
Error:(1, -1) Gradle: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body2'.
Error:(1, -1) Gradle: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Button'.
Error:(1, -1) Gradle: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Caption'.
Error:(1, -1) Gradle: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display1'.
Error:(1, -1) Gradle: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display2'.
Error:(1, -1) Gradle: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display3'.
Error:(1, -1) Gradle: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display4'.
Error:(1, -1) Gradle: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Headline'.
Error:(1, -1) Gradle: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Inverse'.
Error:(1, -1) Gradle: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Large'.

最佳答案

您正在使用 appcompat v21。

您必须使用 api21 编译您的项目。
在您的 build.gradle 中更改:

android {
    compileSdkVersion 21
    //...
}

如果您要切换到 appcompat 23,则必须使用 API23。

android {
    compileSdkVersion 23
    //...
}

关于android - 在新项目中以非零退出值 1 完成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32158388/

相关文章:

android - 测试 RxJava 无限间隔

android - 在 gradle android library kotlin 项目中禁用 META-INF/* 生成

java - 如何将多个 SLF4J 绑定(bind)排除到 LOG4J

java - android studio java.lang.NoClassDefFoundError Gson

java - 在 Android 中以自定义格式显示相对日期

android - 如何重命名我的 Android 应用程序?

android - CameraX - I/zygote : Rejecting re-init on previously-failed class java. lang.Class<androidx.core.view.ViewCompat$2>

android - 在 Android 的蓝牙中,BluetoothSocket.connect 是否调用 SDP 来获取新 channel

jenkins - Gradle - 不同的任务使用不同的参数

java - 如果未以某种格式提供,Gradle 无法解析我的依赖项