首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Android资源3.3.0编译失败-alpha02

Android资源3.3.0编译失败-alpha02
EN

Stack Overflow用户
提问于 2018-07-06 10:10:47
回答 4查看 23K关注 0票数 6

每当我尝试构建我的项目时,我都会得到这样的错误:

代码语言:javascript
运行
复制
Android resource compilation failed
Output:  
C:\Users\smart\AndroidStudioProjects\ShoppingList\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:497: error: :listItem>.
C:\Users\smart\AndroidStudioProjects\ShoppingList\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:498: error: :listItem>.
C:\Users\smart\AndroidStudioProjects\ShoppingList\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:499: error: :listItem>.
C:\Users\smart\AndroidStudioProjects\ShoppingList\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:503: error: :listItem>.
C:\Users\smart\AndroidStudioProjects\ShoppingList\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:504: error: :listItem>.

Command: C:\Users\smart\.gradle\caches\transforms-1\files-1.1\aapt2-3.3.0-alpha02-4818971-windows.jar\a281fb5dd58b50951126c2252f73d452\aapt2-3.3.0-alpha02-4818971-windows\aapt2.exe compile --legacy \
    -o \
    C:\Users\smart\AndroidStudioProjects\ShoppingList\app\build\intermediates\res\merged\debug \
    C:\Users\smart\AndroidStudioProjects\ShoppingList\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml
Daemon:  AAPT2 aapt2-3.3.0-alpha02-4818971-windows Daemon #2

有问题的xml行是:

代码语言:javascript
运行
复制
<color name="colorPrimary">#d50000</color>
<color name="colorPrimaryDark">#b71c1c</color>
<color name="colorAccent">#757575</color>

<listItem name="windowActionBar">false</listItem>
<listItem name="windowNoTitle">true</listItem>

我正在使用

代码语言:javascript
运行
复制
classpath 'com.android.tools.build:gradle:3.3.0-alpha02'

我的app gradle文件是:

代码语言:javascript
运行
复制
apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.my.kellen.shoppinglist"
        minSdkVersion 14
        targetSdkVersion 26
        versionCode 2
        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.2'
    implementation 'com.android.support:design:26.1.0'

implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-core:16.0.1'

implementation 'com.bignerdranch.android:expandablerecyclerview:1.0.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'

// Room components
implementation "android.arch.persistence.room:runtime:1.1.1"
annotationProcessor "android.arch.persistence.room:compiler:1.1.1"
androidTestImplementation "android.arch.persistence.room:testing:1.1.1"

// Lifecycle components
implementation "android.arch.lifecycle:extensions:1.1.1"
annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
}

apply plugin: 'com.google.gms.google-services'

有人能帮我吗?我已经尝试了清理和重建项目,并检查了所有有问题的行。我最近甚至没有修改它们,所以我不知道发生了什么。

编辑-我已经将我的classpath恢复到3.1.3,并将distributionUrl恢复到4.5,现在我得到了一个不同的错误消息:

代码语言:javascript
运行
复制
Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details.

日志上写着:

代码语言:javascript
运行
复制
error: :listItem>.
Message{kind=ERROR, text=error: :listItem>., sources=`[C:\Users\smart\AndroidStudioProjects\ShoppingList\app\src\main\res\values\styles.xml:17:5-90], original message=, tool name=Optional.of(AAPT)}` 

并指向应该有效的两个不同的xml行:

代码语言:javascript
运行
复制
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/> 
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51202130

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档