值-lddtr-v21.xml错误+ AAPT2尝试在Android中构建时出错

时间:2018-02-24 12:38:16

标签: android android-studio android-gradle

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

C:\ Users \用户名\文件\ MyApp的\产品\项目\ proast \应用\建立\中间体\增量\ mergeDebugResources \ merged.dir \值-ldltr-V21 \值-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'.
  

错误:java.util.concurrent.ExecutionException:com.android.tools.aapt2.Aapt2Exception:AAPT2错误:检查日志以获取详细信息

我不知道发生了什么,我尝试搜索和应用我在网上和网站上找到的一些方法,但我认为我是完全白痴,因为我无法做到这一点工作。

这是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,23 java jdk:1.8.0_144

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

提前致谢, 斯蒂芬

1 个答案:

答案 0 :(得分:3)

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