Android Studio构建失败,出现此错误:-守护进程:AAPT2 aapt2-3.2.0-rc02-4818971-osx守护进程#0

时间:2018-08-28 11:33:48

标签: android kotlin

在android studio 3.2 RC 2中编译android代码时遇到此问题。 我已经删除了构建文件夹,但结果仍然相同。

Android资源链接失败

Output:  /Users/jassi/Library/Mobile Documents/com~apple~CloudDocs/Documents/Documents – jaspreet’s MacBook Air/Projects/bolotalk-android-sdk/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:5657: error: style attribute 'attr/textColorError (aka com.BoloTalk:attr/textColorError)' not found.
            error: failed linking references.

        Command: /Users/jassi/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.0-rc02-4818971-osx.jar/f597d2f9b6d8fcd1de4112192ac94363/aapt2-3.2.0-rc02-4818971-osx/aapt2 link -I\
                /Users/jassi/Library/Android/sdk/platforms/android-28/android.jar\
                --manifest\
                /Users/jassi/Library/Mobile Documents/com~apple~CloudDocs/Documents/Documents – jaspreet’s MacBook Air/Projects/bolotalk-android-sdk/app/build/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml\
                -o\
                /Users/jassi/Library/Mobile Documents/com~apple~CloudDocs/Documents/Documents – jaspreet’s MacBook Air/Projects/bolotalk-android-sdk/app/build/intermediates/processed_res/debug/processDebugResources/out/resources-debug.ap_\
                -R\
                @/Users/jassi/Library/Mobile Documents/com~apple~CloudDocs/Documents/Documents – jaspreet’s MacBook Air/Projects/bolotalk-android-sdk/app/build/intermediates/incremental/processDebugResources/resources-list-for-resources-debug.ap_.txt\
                --auto-add-overlay\
                --java\
                /Users/jassi/Library/Mobile Documents/com~apple~CloudDocs/Documents/Documents – jaspreet’s MacBook Air/Projects/bolotalk-android-sdk/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r\
                --custom-package\
                com.BoloTalk\
                -0\
                apk\
                --output-text-symbols\
                /Users/jassi/Library/Mobile Documents/com~apple~CloudDocs/Documents/Documents – jaspreet’s MacBook Air/Projects/bolotalk-android-sdk/app/build/intermediates/symbols/debug/R.txt\
                --no-version-vectors
        Daemon:  AAPT2 aapt2-3.2.0-rc02-4818971-osx Daemon #0

以下是我的 build.gradle 文件:

    apply plugin: 'com.android.application'
    apply plugin: 'kotlin-android'
    apply plugin: 'kotlin-android-extensions'

    android {
        signingConfigs {
            android {
                keyAlias 'android'
                keyPassword 'android'
                storeFile file('/Users/jaspreet/Documents/Projects/bolotalk-android-sdk/keystoreGoogle')
                storePassword 'android'
            }
        }
        compileSdkVersion 28
        defaultConfig {
            applicationId "com.BoloTalk"
            minSdkVersion 21
            targetSdkVersion 28
            versionCode 43
            versionName "43"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
            signingConfig signingConfigs.android
            multiDexEnabled true
        }
        dataBinding {
            enabled = true
        }
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                signingConfig signingConfigs.android
                debuggable false
            }
        }
        lintOptions {
            checkReleaseBuilds false
            // Or, if you prefer, you can continue to check for errors in release builds,
            // but continue the build even when errors are found:
            abortOnError false
        }
        productFlavors {
        }
    //    compileOptions {
    //        sourceCompatibility = '1.8'
    //        targetCompatibility = '1.8'
    //    }
        buildToolsVersion '28.0.2'

        configurations.all {
            resolutionStrategy {
                force 'com.android.support:support-v4:27.1.0'
            }}

        configurations {
            all*.exclude group: 'com.android.support', module: 'support-v13'
        }
        configurations.all {
            resolutionStrategy.force 'com.android.support:support-v4:24.0.0'
        }

    }


    dependencies {
        implementation fileTree(include: ['*.jar'], dir: 'libs')
        implementation 'com.android.support:design:28.0.0-rc01'
        implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
        implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
        implementation 'com.android.support.constraint:constraint-layout:1.1.2'
        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 library
        implementation 'android.arch.persistence.room:runtime:1.0.0'
        annotationProcessor "android.arch.persistence.room:compiler:1.0.0"
        implementation 'com.github.adroitandroid:ChipCloud:2.2.1'
        implementation 'com.github.bumptech.glide:glide:4.1.1'
        implementation 'com.github.nkzawa:socket.io-client:0.3.0'
        implementation 'com.wdullaer:materialdatetimepicker:3.3.0'
        implementation 'com.google.dagger:dagger:2.9'
        annotationProcessor "com.google.dagger:dagger-compiler:2.9"
        compileOnly 'javax.annotation:jsr250-api:1.0'
        implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
        implementation 'de.hdodenhof:circleimageview:2.1.0'
        implementation 'com.squareup.retrofit2:retrofit:2.3.0'
        implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
        implementation 'com.jakewharton.rxbinding:rxbinding:0.4.0'
        //
        implementation 'org.greenrobot:eventbus:3.1.1'
        implementation 'com.google.firebase:firebase-invites:16.0.3'
        implementation 'com.google.firebase:firebase-core:16.0.3'
        implementation 'com.google.firebase:firebase-messaging:17.3.0'
        implementation 'com.google.android.gms:play-services-auth:15.0.1'
        //
        implementation 'com.braintreepayments.api:drop-in:3.0.1'
        implementation 'com.github.onurkagan:ktoast:1.0.2'
        implementation 'com.android.billingclient:billing:1.0'
        implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
        // implementation 'androidx.multidex:multidex:2.0.0'
    }
    apply plugin: 'com.google.gms.google-services'
    repositories {
        mavenCentral()
    }

1 个答案:

答案 0 :(得分:0)

尝试使用目标和编译SDK 27而不是28。由于仍然是28版本,因此存在一些问题。

targetSdkVersion 27
compileSdkVersion 27
buildToolsVersion '27.0.3'

,并将27.1.1用作所有支持版本,而不是28.0.0-rc01