com.android.builder.internal.aapt.v2.Aapt2InternalException:AAPT2 aapt2-3.5.2-5435860-windows守护程序#1:守护程序启动失败

时间:2019-11-11 15:01:18

标签: android android-studio android-appcompat androidx

我正在根据Google的新要求将我的旧应用代码更新为最新的SDK版本29,但是迁移到Android X会导致问题

//build.gradle (Module:app) file

apply plugin: 'com.android.application'

android {
    compileSdkVersion 29

    defaultConfig {
    applicationId "app.com.wallpapers"
    minSdkVersion 16
    targetSdkVersion 29
    versionCode 64
    versionName "7.4"
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

    multiDexEnabled true

}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

packagingOptions {
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/LICENSE-FIREBASE.txt'
    exclude 'META-INF/notice'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/license'
    exclude 'META-INF/license.txt'
}
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
    exclude group: 'com.android.support', module: 'support-annotations'
})

//Migration to AndroidX from AppCompact

implementation files('libs/sqliteassethelper-2.0.1.jar')
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.browser:browser:1.0.0'

implementation 'com.google.firebase:firebase-messaging:20.0.0' 
implementation 'com.google.firebase:firebase-core:17.2.1'
implementation 'com.google.firebase:firebase-storage:19.1.0'
implementation 'com.firebaseui:firebase-ui-database:1.0.1'
implementation 'com.firebase:firebase-client-android:2.5.2'
implementation 'com.google.firebase:firebase-auth:19.1.0'
implementation 'com.google.android.gms:play-services-ads:18.3.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0' 
implementation 'com.google.firebase:firebase-database:19.2.0' 

implementation 'com.squareup.picasso:picasso:2.71828' 
implementation 'androidx.multidex:multidex:2.0.1'
testImplementation 'junit:junit:4.12'
implementation 'me.biubiubiu.justifytext:library:1.1'
implementation 'com.github.bumptech.glide:glide:4.10.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
}

原因:com.android.builder.internal.aapt.v2.Aapt2InternalException:AAPT2 aapt2-3.5.2-5435860-windows守护程序#1:守护程序启动失败 通常情况下不应发生这种情况,如果确实如此,请提出问题。     在com.android.builder.internal.aapt.v2.Aapt2Daemon.handleError(Aapt2Daemon.kt:162)     在com.android.builder.internal.aapt.v2.Aapt2Daemon.handleError $ default(Aapt2Daemon.kt:160)     在com.android.builder.internal.aapt.v2.Aapt2Daemon.checkStarted(Aapt2Daemon.kt:69)     在com.android.builder.internal.aapt.v2.Aapt2Daemon.compile(Aapt2Daemon.kt:91)     在com.android.builder.internal.aapt.v2.Aapt2DaemonManager $ LeasedAaptDaemon.compile(Aapt2DaemonManager.kt:169)     在com.android.build.gradle.internal.res.Aapt2CompileRunnable $ run $ 1.invoke(Aapt2CompileRunnable.kt:38)     在com.android.build.gradle.internal.res.Aapt2CompileRunnable $ run $ 1.invoke(Aapt2CompileRunnable.kt:29)     在com.android.build.gradle.internal.res.namespaced.Aapt2DaemonManagerService.useAaptDaemon(Aapt2DaemonManagerService.kt:66)     在com.android.build.gradle.internal.res.namespaced.Aapt2DaemonManagerService.useAaptDaemon $ default(Aapt2DaemonManagerService.kt:64)     在com.android.build.gradle.internal.res.Aapt2CompileRunnable.run(Aapt2CompileRunnable.kt:35)     在com.android.build.gradle.internal.tasks.Workers $ ActionFacade.run(Workers.kt:335)     在org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:39)     在org.gradle.workers.internal.NoIsolationWorkerFactory $ 1 $ 1.execute(NoIsolationWorkerFactory.java:61)     在org.gradle.workers.internal.AbstractWorker $ 1.call(AbstractWorker.java:44)     在org.gradle.workers.internal.AbstractWorker $ 1.call(AbstractWorker.java:41)     在org.gradle.internal.operations.DefaultBuildOperationExecutor $ CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)     在org.gradle.internal.operations.DefaultBuildOperationExecutor $ CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)处     在org.gradle.internal.operations.DefaultBuildOperationExecutor $ 1.execute(DefaultBuildOperationExecutor.java:165)     在org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)处     在org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)     在org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)     在org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)     在org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)     在org.gradle.workers.internal.NoIsolationWorkerFactory $ 1.execute(NoIsolationWorkerFactory.java:55)     在org.gradle.workers.internal.DefaultWorkerExecutor $ 1.call(DefaultWorkerExecutor.java:105)     在org.gradle.workers.internal.DefaultWorkerExecutor $ 1.call(DefaultWorkerExecutor.java:99)     在org.gradle.internal.work.DefaultConditionalExecutionQueue $ ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:215)处     在org.gradle.internal.work.DefaultConditionalExecutionQueue $ ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:164)     在org.gradle.internal.work.DefaultConditionalExecutionQueue $ ExecutionRunner.run(DefaultConditionalExecutionQueue.java:131)     ...另外3个 引起原因:com.android.builder.internal.aapt.v2.Aapt2InternalException:无法启动AAPT2进程。     在com.android.builder.internal.aapt.v2.Aapt2DaemonImpl.stopQuietly(Aapt2DaemonImpl.kt:127)     在com.android.builder.internal.aapt.v2.Aapt2DaemonImpl.startProcess(Aapt2DaemonImpl.kt:114)     在com.android.builder.internal.aapt.v2.Aapt2Daemon.checkStarted(Aapt2Daemon.kt:65)     ...另外29个 原因:java.io.IOException:进程意外退出。     在com.android.builder.internal.aapt.v2.Aapt2DaemonImpl.startProcess(Aapt2DaemonImpl.kt:115)     ...再加30

1 个答案:

答案 0 :(得分:0)

通过更新Windows并安装Windows Universal C运行时(UCRT)更新来解决