这里的错误是什么,我该如何解决?我尝试重建我的代码,但它不起作用。org.gradle.internal.UncheckedException: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource compilation failedOutput: C:\Users\dasorto\AndroidStudioProjects\ENews3\app\src\main\res\layout-enm-small\activity_second.xml:2: error: not well-formed (invalid token).Command: C:\Users\dasorto\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar\fcf510a17b6427e22ff6873eb8551d38\aapt2-3.2.0-4818971-windows\aapt2.exe compile --legacy \ -o \ C:\Users\dasorto\AndroidStudioProjects\ENews3\app\build\intermediates\res\merged\debug \ C:\Users\dasorto\AndroidStudioProjects\ENews3\app\src\main\res\layout-enm-small\activity_second.xmlDaemon: AAPT2 aapt2-3.2.0-4818971-windows Daemon #4 at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:63) at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:40) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:76) at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:50) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:124) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
2 回答
SMILET
TA贡献1796条经验 获得超4个赞
该文件C:\Users\dasorto\AndroidStudioProjects\ENews3\app\src\main\res\layout-enm-small\activity_second.xml
格式不正确,这意味着不是格式正确的 XML 文件。很可能它缺少一些结束标签(例如,您打开 a<style>
并忘记用 a 关闭它</style>
)。检查该文件是否有任何未关闭的标签,你应该没问题。
偶然的你
TA贡献1841条经验 获得超3个赞
检查您的布局文件activity_second.xml
line 2
,有错误。
只需遵循此错误行:
`C:\Users\dasorto\AndroidStudioProjects\ENews3\app\src\main\res\layout-enm-small\activity_second.xml:2: error: not well-formed (invalid token)`
你会发现这个问题。
添加回答
举报
0/150
提交
取消