如何调试错误“ AAPT2错误:检查日志以获取详细信息”?

时间:2018-06-29 13:22:24

标签: android aapt2

这是我的日志文件。请仔细检查:

/**********************************************************************

2018-06-29 18:34:27,811 [thread 101]   INFO -                    #InstantRun - Local build timestamp is empty! 

2018-06-29 18:34:28,330 [thread 101]   INFO - ools.idea.fd.InstantRunBuilder - BuildCause: MISMATCHING_TIMESTAMPS, BuildMode: FULL 

2018-06-29 18:34:28,331 [e-1024-b02]   INFO - ild.invoker.GradleBuildInvoker - About to execute Gradle tasks: [:app:assembleDebug] 

2018-06-29 18:34:28,331 [e-1024-b02]   INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender activation event: BUILD_EXECUTOR_CREATED 

2018-06-29 18:34:28,344 [ thread 90]   INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:/Program Files/Android/Android Studio/jre 

2018-06-29 18:34:28,358 [ thread 90]   INFO - oject.common.GradleInitScripts - init script file sync.local.repo contents "allprojects {\n  buildscript {\n    repositories {\n      maven { url 'C:\\\\Program Files\\\\Android\\\\Android Studio\\\\gradle\\\\m2repository'}\n    }\n  }\n  repositories {\n      maven { url 'C:\\\\Program Files\\\\Android\\\\Android Studio\\\\gradle\\\\m2repository'}\n  }\n}\n" 

2018-06-29 18:34:28,359 [ thread 90]   INFO - ild.invoker.GradleBuildInvoker - Build command line options: [--configure-on-demand, -Pandroid.injected.invoked.from.ide=true, -Pandroid.injected.build.api=22, -Pandroid.injected.build.density=hdpi, -Pandroid.injected.build.abi=armeabi-v7a,armeabi, -Pandroid.injected.restrict.variant.name=debug, -Pandroid.injected.restrict.variant.project=:app, -Pandroid.optional.compilation=INSTANT_DEV,FULL_APK, -Pandroid.injected.coldswap.mode=MULTIAPK, --no-build-cache, --init-script, C:\Users\******\AppData\Local\Temp\sync.local.repo1354.gradle] 

2018-06-29 18:34:28,406 [ thread 90]   INFO - xecution.GradleExecutionHelper - Passing command-line args to Gradle Tooling API: --configure-on-demand -Pandroid.injected.invoked.from.ide=true -Pandroid.injected.build.api=22 -Pandroid.injected.build.density=hdpi -Pandroid.injected.build.abi=armeabi-v7a,armeabi -Pandroid.injected.restrict.variant.name=debug -Pandroid.injected.restrict.variant.project=:app -Pandroid.optional.compilation=INSTANT_DEV,FULL_APK -Pandroid.injected.coldswap.mode=MULTIAPK --no-build-cache --init-script C:\Users\******\AppData\Local\Temp\sync.local.repo1354.gradle 

2018-06-29 18:34:28,465 [e-1024-b02]   INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender activation event: BUILD_STARTED 

2018-06-29 18:34:28,466 [e-1024-b02]   INFO - idea.project.IndexingSuspender - Starting batch update for project: Project 'F:\Android\Gallary_Frame' Gallary_Frame 

2018-06-29 18:34:32,117 [e-1024-b02]   INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender deactivation event: BUILD_FINISHED 

2018-06-29 18:34:32,118 [e-1024-b02]   INFO - idea.project.IndexingSuspender - Finishing batch update for project: Project 'F:\Android\Gallary_Frame' Gallary_Frame 

2018-06-29 18:34:32,118 [e-1024-b02]   INFO - ild.invoker.GradleBuildInvoker - Gradle build finished in 3s 771ms 

2018-06-29 18:34:32,129 [e-1024-b02]   INFO - pl.ProjectRootManagerComponent - project roots have changed 

2018-06-29 18:34:32,220 [thread 101]   INFO - a.gradle.run.MakeBeforeRunTask - Couldn't get post build models. 

2018-06-29 18:34:32,225 [thread 101]   INFO - a.gradle.run.MakeBeforeRunTask - Gradle invocation complete, success = false 

2018-06-29 18:34:32,326 [e-1024-b02]   INFO - pl.ProjectRootManagerComponent - project roots have changed 

2018-06-29 18:34:32,438 [cessToken]]   INFO - pl.ProjectRootManagerComponent - project roots have changed 

2018-06-29 18:34:32,673 [thread 101]   INFO - .diagnostic.PerformanceWatcher - Pushing properties took 107ms; general responsiveness: ok; EDT responsiveness: ok 

2018-06-29 18:34:34,143 [thread 101]   INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 1470ms; general responsiveness: ok; EDT responsiveness: 0/1 sluggish, 1/1 very slow 

2018-06-29 18:34:34,143 [thread 101]   INFO - indexing.UnindexedFilesUpdater - Unindexed files update started: 14 files to update 

2018-06-29 18:34:34,245 [thread 101]   INFO - .diagnostic.PerformanceWatcher - Unindexed files update took 102ms; general responsiveness: ok; EDT responsiveness: 1/1 sluggish 
**********************************************************************/

我真的不知道发生了什么。在代码中没有error,但是尝试5到6次后,它可以成功构建并安装。

但是,在进行每一个小的更改时,我都必须再次尝试5-6次或更多次才能构建项目。

应用程序运行正常,但是这个Android Studio花费了我很多时间进行细微的更改。

我已经尝试了所有发布在互联网上的解决方案。

1 个答案:

答案 0 :(得分:0)

从设置中禁用即时运行选项。 Settings -> Build, Execution, Deployment -> Instant Run。然后取消选中该框以将其禁用。现在Clean Build,然后再次运行。应该可以。