gpt4 book ai didi

android - 尝试在 Android 中构建时出现 Values-ldltr-v21.xml 错误 + AAPT2 错误

转载 作者:搜寻专家 更新时间:2023-11-01 07:43:54 25 4
gpt4 key购买 nike

长话短说,我是 android 的完全菜鸟,从 codecanyon 购买了一个应用程序代码用于我的下一个项目,我认为它使用起来很简单,因为几周前我已经做过类似的事情。无论如何,在尝试构建/测试运行该应用程序时,我收到以下错误:

C:\Users\用户名\Documents\MyApp\product\Project\proast\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-ldltr-v21\values-ldltr-v21.xml

错误:找不到文件。

Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Execution failed for task ':app:mergeDebugResources'.

Error: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details

我不知道发生了什么,我尝试搜索并应用我在网上和这个网站上找到的一些方法,但我认为我是个彻头彻尾的白痴,因为我无法让它发挥作用。

这是 build.gradle:

buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.0.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

和 build.gradle(模块应用)

    apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.pro.ast"
minSdkVersion 17
targetSdkVersion 26
versionCode 8
versionName "1.3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')

compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:cardview-v7:26.1.0'

//retrofit, gson
compile 'com.squareup.retrofit2:converter-scalars:2.1.0'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'

//firebase
compile 'com.google.firebase:firebase-core:11.6.0'
compile 'com.google.firebase:firebase-messaging:11.6.0'
compile 'com.google.firebase:firebase-ads:11.6.0'

//glide
compile 'com.github.bumptech.glide:glide:4.3.1'

//circular imageview
compile 'de.hdodenhof:circleimageview:2.1.0'

}

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

我有 android studio 3.0.1,安装的 Android SDK:27、26、25、24、23java jdk: 1.8.0_144

有什么想法吗?真的很感激,我想我最终会退还应用代码,因为卖家还没有回应。

提前致谢,斯蒂芬

最佳答案

这很可能与 AAPT2 对 Windows 路径的限制有关。它目前在包含非 ASCII 字符的路径和长度超过大约 145 个字符的路径方面存在问题。
这已在 android 问题跟踪器中标记为已修复,但尚未发布修复程序。

关于android - 尝试在 Android 中构建时出现 Values-ldltr-v21.xml 错误 + AAPT2 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48962959/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com