首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >更新AndroidStudio3.3-3.4后生成AAPT2错误

更新AndroidStudio3.3-3.4后生成AAPT2错误
EN

Stack Overflow用户
提问于 2019-04-20 10:24:28
回答 2查看 5.9K关注 0票数 4

在更新AndroidStudio3.3到3.4之后,它会出现错误。它得到了一个错误,即AAPT2,这给了我一个建议我喜欢这个:

在此构建中使用了不推荐的Gradle特性,使其与Gradle 6.0不兼容。使用请参阅

代码语言:javascript
运行
复制
gradle.properties
org.gradle.warning.mode=all

但还是不起作用。

错误:

代码语言:javascript
运行
复制
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeIntroMakerDebugResources'.
> 8 exceptions were raised by workers:
  com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #2: Daemon startup failed
  This should not happen under normal circumstances, please file an issue if it does.
  com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #0: Daemon startup failed
  This should not happen under normal circumstances, please file an issue if it does.
  com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #1: Daemon startup failed
  This should not happen under normal circumstances, please file an issue if it does.
  com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #3: Daemon startup failed
  This should not happen under normal circumstances, please file an issue if it does.
  com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #4: Daemon startup failed
  This should not happen under normal circumstances, please file an issue if it does.
  com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #5: Daemon startup failed
  This should not happen under normal circumstances, please file an issue if it does.
  com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #6: Daemon startup failed
  This should not happen under normal circumstances, please file an issue if it does.
  com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.0-5326820-windows Daemon #7: Daemon startup failed
  This should not happen under normal circumstances, please file an issue if it does.


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 23s

这是Build.gradle文件:

代码语言:javascript
运行
复制
buildscript {

repositories {
    maven { url 'https://maven.fabric.io/public' }
}

dependencies {
    // The Fabric Gradle plugin uses an open ended version to react
    // quickly to Android tooling updates
    classpath 'io.fabric.tools:gradle:1.+'
}
 }

plugins {
id "com.onesignal.androidsdk.onesignal-gradle-plugin" version "0.12.1"
 }

   apply plugin: 'com.android.application'
 //Put Fabric plugin after Android plugin
 apply plugin: 'io.fabric'
  apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'

repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
signingConfigs {
    config {
        keyAlias 'maker_key'
        keyPassword '!23342'
        storeFile 
       file('E:/axita.savani/Android_Project/AppCred/maker_key.jks')
        storePassword '!23342'
    }
}
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
    applicationId "com.example.myapplication"
    minSdkVersion 17
    targetSdkVersion 28
       vectorDrawables.useSupportLibrary = true
    multiDexEnabled true
    ndk {
        abiFilters "armeabi-v7a", "x86", "arm64-v8a"
    }
}
buildTypes {
    debug {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android- 
     optimize.txt'), 'proguard-rules.pro'
        zipAlignEnabled true
        shrinkResources false
        externalNativeBuild { ndkBuild { cFlags '-DDEBUG' } }
    }
    release {
        debuggable false
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android- 
     optimize.txt'), 'proguard-rules.pro'
        zipAlignEnabled true
        shrinkResources true
        externalNativeBuild { ndkBuild { cFlags '-DRELEASE' } }
    }
}

sourceSets {
    main {
        res.srcDirs =
                [
                        'src/main/res/layouts/activities',
                        'src/main/res/layouts/fragments',
                        'src/main/res/layouts/background',
                        'src/main/res/layouts/camera',
                        'src/main/res/layouts/sticker',
                        'src/main/res/layouts/text',
                        'src/main/res/layouts/editor',
                        'src/main/res/layouts/commom',
                        'src/main/res/layouts/other',
                        'src/main/res/layouts/videotrimmer',
                        'src/main/res/layouts/obgallarylib',
                        'src/main/res/layouts/template',
                        'src/main/res/layouts/eraser',
                        'src/main/res/layouts/user_guide',
                        'src/main/res/layouts/my_art',
                        'src/main/res/layouts/audio',
                        'src/main/res/layouts/video',

                        'src/main/res/layouts-land/activities',
                        'src/main/res/layouts-land/fragments',
                        'src/main/res/layouts-land/background',
                        'src/main/res/layouts-land/camera',
                        'src/main/res/layouts-land/sticker',
                        'src/main/res/layouts-land/text',
                        'src/main/res/layouts-land/editor',
                        'src/main/res/layouts-land/commom',
                        'src/main/res/layouts-land/other',
                        'src/main/res/layouts-land/my_art',

                        'src/main/res/layouts',
                        'src/main/res/layouts-land',
                        'src/main/res'
                ]
    }
}

  android {
    aaptOptions {
        ignoreAssetsPattern "!*ffprobe"
    }
    dexOptions {
        jumboMode true
    }
    lintOptions {
        disable 'GoogleAppIndexingWarning'
        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
    }
}

def flavorName = 'Maker'
// todo change in flavorname which app is used

externalNativeBuild {
    ndkBuild {
        path "src/${flavorName}/jni/Android.mk"
    }
}

flavorDimensions "default"

product flavors {

    // ONE SIGNAL IDs
        Maker {
        applicationId "com.example.maker"

        versionCode 9
        versionName "9.0"
        flavorDimensions "default"
        signingConfig signingConfigs.config
        setProperty("archivesBaseName", 
    "Business_$versionName.$versionCode")
    }


}

packagingOptions {
    exclude 'META-INF/DEPENDENCIES.txt'
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/dependencies.txt'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/LGPL2.1'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/notice.txt'
}
compileOptions {
    sourceCompatibility 1.8
    targetCompatibility 1.8
}
}

  dependencies {
/*TODO one Signal*/
implementation 'com.onesignal:OneSignal:3.10.6'

implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:appcompat-v7:28.0.0'
 //    implementation 'com.android.support:customtabs:27.1.1'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
//implementation 'com.android.support:palette-v7:27.1.1'
implementation 'com.google.code.gson:gson:2.8.5'

 //    implementation 'com.github.yalantis:ucrop:2.2.1'
implementation 'com.github.yalantis:ucrop:2.2.2'

//    implementation 'com.kbeanie:multipicker:1.1.31@aar'
   //    implementation project(path: ':multipicker')

    /*database Dislay From chorome used this */
implementation 'com.facebook.stetho:stetho:1.5.0'

implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'

/* Pinch zoom image */
//implementation 'com.davemorrissey.labs:subsampling-scale-image- 
 view:3.6.0'

implementation 'com.viewpagerindicator:library:2.4.1@aar'

/*GIF Image View*/
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.16'

/* YOYO animation*/
implementation 'com.daimajia.easing:library:2.0@aar'
implementation 'com.daimajia.androidanimations:library:2.3@aar'

implementation 'com.codemybrainsout.rating:ratingdialog:1.0.8'

/* FCM */
//    implementation 'com.google.firebase:firebase-messaging:15.0.2'
/* AdMob */
implementation 'com.google.firebase:firebase-ads:17.2.0'

/* InAppPurchase */
implementation 'com.android.billingclient:billing:1.2'

/* EU User Consent SDK */
implementation 'com.google.android.ads.consent:consent-library:1.0.7'

//For Crash analytics
implementation('com.crashlytics.sdk.android:crashlytics:2.9.7@aar') {
    transitive = true
}

implementation 'com.azeesoft.lib.colorpicker:colorpicker:1.0.9@aar'
implementation 
'com.h6ah4i.android.widget.verticalseekbar:verticalseekbar:0.7.2'


implementation 'nl.bravobit:android-ffmpeg:1.1.5'
implementation 'com.googlecode.mp4parser:isoparser:1.1.22'
/*storage for path */
implementation 'com.snatik:storage:2.1.0'
/*exo player for Audio and Video */
implementation 'com.devbrackets.android:exomedia:4.3.0'

/*Download file From Server */
implementation 'com.mindorks.android:prdownloader:0.5.0'

      /*Ob Volly library*/
implementation 'com.optimumbrew.corelib:networking-volly:8.0.8'
   /*Audio picker library */
implementation 'com.optimumbrew.picker:audiopicker:1.1.17'

/* Optimumbrew Image loader*/
implementation 'com.optimumbrew.obglide:obglide:2.0.2'
/* inhouse ads library*/
implementation 'com.optimumbrew.obinhouseads:obinhouseads:11.0.11'

implementation project(path: ':spacelib')

/*Video Tools*/
implementation project(':video-record')
implementation project(':video-compressor')
implementation project(':video-effect')

implementation 'com.daasuu:ExoPlayerFilter:0.2.3'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.reactivex.rxjava2:rxjava:2.1.5'
implementation 'com.tbruyelle.rxpermissions2:rxpermissions:0.9.4@aar'

implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

//exo player note : Don't upgrade of exoplayer vesion
implementation 'com.google.android.exoplayer:exoplayer:2.9.1'

implementation 'com.android.volley:volley:1.1.1'




}
   //apply plugin: 'com.google.gms.google-services' // Use for FCM Push
EN

回答 2

Stack Overflow用户

发布于 2019-04-20 10:32:45

使用Android终端中的./gradlew构建警告模式来获取更多信息。

要做的第一件事总是使缓存无效+重新启动。

票数 0
EN

Stack Overflow用户

发布于 2019-04-20 11:18:37

请将build script {转换为没有空格的buildscript {。看起来不错。还尝试在“gradle-rapper.properties”中使用distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip并再次同步。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55772546

复制
相关文章

相似问题

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