How to debug the error "AAPT2 error: check logs for details"?
How to debug the error "AAPT2 error: check logs for details"?
这是我的日志文件。请仔细阅读:
/**********************************************************************
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 花了我很多时间进行小改动。
我已经尝试了网上发布的所有可能的解决方案。
从您的设置中禁用即时 运行 选项。 Settings -> Build, Execution, Deployment -> Instant Run
。然后取消选中该框以将其禁用。现在再次 Clean Build
和 运行。它应该可以工作。
这是我的日志文件。请仔细阅读:
/**********************************************************************
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 花了我很多时间进行小改动。
我已经尝试了网上发布的所有可能的解决方案。
从您的设置中禁用即时 运行 选项。 Settings -> Build, Execution, Deployment -> Instant Run
。然后取消选中该框以将其禁用。现在再次 Clean Build
和 运行。它应该可以工作。