繁体   English   中英

任务':app:processDebugResources'执行失败

[英]Execution Failed for task ':app:processDebugResources'

我从build-tools\\23.0.2\\ (Aapt.exe)收到此错误

以非零退出值1完成。

我正在使用Android Studio Version 1.4.1

我将API level 23与更新的构建工具一起使用,并且我的日志猫经常string.xml ,我在其中创建了字符串以将其引用给列表视图。

执行任务:[:app:generateDebugSources,:app:generateDebugAndroidTestSources,:app:compileDebugSources,:app:compileDebugAndroidTestSources,:mylibrary:generateDebugSources,:mylibrary:generateDebugAndroidTestSources,:mylibrary:compileDebugSources,:mylibrary:compileDebugAndroidTestSources]

按需配置是一个孵化功能。 :app:preBuild UP-TO-DATE:app:preDebugBuild UP-TO-DATE:app:checkDebugManifest:app:preReleaseBuild UP-TO-DATE:app:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE:app:prepareComAndroidSupportDesign2311Library UP-TO-DATE: app:prepareComAndroidSupportRecyclerviewV72311Library UP-TO-DATE:app:prepareComAndroidSupportSupportV42311Library UP-TO-DATE:app:prepareDebugDependencies:app:compileDebugAidl UP-TO-DATE:app:compileDebugRenderscript UP-TO-DATE:app:TOrateDebugBuild :generateDebugAssets UP-TO-DATE:app:mergeDebugAssets UP-TO-DATE:app:generateDebugResValues UP-TO-DATE:app:generateDebugResources UP-TO-DATE:app:mergeDebugResources UP-TO-DATE:app:processDebugManifest UP-TO-DATE -DATE:app:processDebugResources AGPBI:{“ kind”:“ error”,“ text”:“撇号前面没有\\(在生命周期回调方法中,您可以声明用户离开并重新进入时活动的行为活动,例如,如果您正在制作流式视频 播放器,当用户切换到另一个应用程序时,您可以暂停视频并终止网络连接。 用户返回时,您可以重新连接到网络,并允许用户从同一位置恢复视频。 )“,”源“:[{”文件“:” C:\\ Users \\ PreciseT3 \\ AndroidStudioProjects \\ ListviewApp1 \\ app \\ src \\ main \\ res \\ values \\ strings.xml“,”位置“:{” startLine“:1 }}],“原版的”:””}

失败

失败:构建失败,发生异常。

  • 出了什么问题:任务':app:processDebugResources'的执行失败。

    com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:处理'command'C:\\ Users \\ PreciseT3 \\ AppData \\ Local \\ Android \\ sdk \\ build-tools \\ 23.0.2 \\ aapt .exe''以非零退出值1结束

  • 尝试:使用--stacktrace选项运行以获取堆栈跟踪。 使用--info或--debug选项运行以获取更多日志输出。

建立失败

总时间:12.649秒

问题出在你的string.xml

查找所有出现的单引号( ' )或撇号,并在每次出现之前添加反斜杠转义符( \\ )。

XML无法处理( '

基本上,将所有'替换为\\'

比较你的gradle文件,我希望这项工作

 apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.2'

    defaultConfig {
        applicationId "info.tranetech.laundry"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
android {
    useLibrary 'org.apache.http.legacy'
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.android.support:recyclerview-v7:+'
    compile 'com.android.support:cardview-v7:+'
    compile 'com.android.support:design:23.0.1'
    compile 'com.squareup.picasso:picasso:+'
    testCompile 'junit:junit:4.12'
    compile 'com.facebook.android:facebook-android-sdk:4.0.0'
    compile files('libs/android-async-http-1.4.4.jar')
    compile 'com.google.android.gms:play-services:8.4.0'
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM