Android resource compilation failed even after swapping attributesHow to use <layout> tag in AndroidMigrating to Gradle Plugin 3.0, aapt2 build errorAndroid Studio 3.1 Canary 6 build failedAAPT2 error: this error happened as soon as i updated my android studio to the latest versionAfter Updating Android Studio 3.1 Get Error while Release Signed APKError: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error when compiling on Windows 10“Compilation failed; see the compiler error output for details.” errorbuild failing during merge resources with Android Gradle plugin 3.3.0Android Studio Compile Time ExceptionAndroid resource compilation failed-duplicate value for resource 'attr/layout_anchorGravity' with confighow to fix 'Android resource compilation failed Output: values_values.arsc.flat: error: failed to open. '

does ability to impeach an expert witness on science or scholarship go too far?

How do Windows version numbers work?

Are there J.S. Bach pieces that do not start with the tonic chord?

P-MOSFET failing

What would be the ideal melee weapon made of "Phase Metal"?

When is pointing out a person's hypocrisy not considered to be a logical fallacy?

Draw 3D Cubes around centre

Filtering fine silt/mud from water (not necessarily bacteria etc.)

How might the United Kingdom become a republic?

Why would an Inquisitive rogue choose to use Insightful Fighting as opposed to using their Cunning Action to Hide?

Does Google Maps take into account hills/inclines for route times?

As a DM, how to avoid unconscious metagaming when dealing with a high AC character?

Is a public company able to check out who owns its shares in very detailed format?

Doing research in academia and not liking competition

Is it rude to tell recruiters I would only change jobs for a better salary?

Bob's unnecessary trip to the shops

Find the wrong number in the given series: 6, 12, 21, 36, 56, 81?

Are villager price increases due to killing them temporary?

Why do they not say "The Baby"

How to plot multiple functions from a list

What does `[$'rn']` mean?

What to put after taking off rear stabilisers from child bicyle?

Supporting developers who insist on using their pet language

Can I play a first turn Simic Growth Chamber to have 3 mana available in the second turn?



Android resource compilation failed even after swapping attributes


How to use <layout> tag in AndroidMigrating to Gradle Plugin 3.0, aapt2 build errorAndroid Studio 3.1 Canary 6 build failedAAPT2 error: this error happened as soon as i updated my android studio to the latest versionAfter Updating Android Studio 3.1 Get Error while Release Signed APKError: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error when compiling on Windows 10“Compilation failed; see the compiler error output for details.” errorbuild failing during merge resources with Android Gradle plugin 3.3.0Android Studio Compile Time ExceptionAndroid resource compilation failed-duplicate value for resource 'attr/layout_anchorGravity' with confighow to fix 'Android resource compilation failed Output: values_values.arsc.flat: error: failed to open. '






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















Following is my fragment_rate.xml layout XML file:



<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
tools:context=".view.ui.RateFragment"
android:layout_height="match_parent">
<FrameLayout
android:layout_height="match_parent"
android:layout_width="match_parent">
</FrameLayout>
</layout>


When I compile this, I have this particular error:



Android resource compilation failed
Output: /home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml:10: error: duplicate attribute.

Command: /home/sparker0i/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/d811e9cf0b30534b0c407565dcc71d36/aapt2-3.2.1-4818971-linux/aapt2 compile --legacy
-o
/home/sparker0i/CurrencyConverter/app/build/intermediates/res/merged/debug
/home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-linux Daemon #0


From this error message, line 10 resolves to the layout_width reference inside the FrameLayout. The strange fact is, when I swap the references of layout_height and layout_width, I still get the same error at line 10.



If there were a duplicate error, I should have got the error message on line 9 when I interchanged, but the error was still at line 10.



Please do help me.



PS. As strange as it sounds, there is also another user facing a similar issue here



EDIT1: Here is a more detailed error log:



org.gradle.internal.UncheckedException: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Failed to compile android resource '/home/sparker0i/CurrencyConverter/app/src/main/res/layout/fragment_rate.xml'.
Output: /home/sparker0i/CurrencyConverter/app/src/main/res/layout/fragment_rate.xml:10: error: duplicate attribute.

Command: /home/sparker0i/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/d811e9cf0b30534b0c407565dcc71d36/aapt2-3.2.1-4818971-linux/aapt2 compile --legacy
-o
/home/sparker0i/CurrencyConverter/app/build/intermediates/res/merged/debug
/home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-linux Daemon #2
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)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:113)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:95)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:256)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:249)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:238)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:663)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:597)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Failed to compile android resource '/home/sparker0i/CurrencyConverter/app/src/main/res/layout/fragment_rate.xml'.
Output: /home/sparker0i/CurrencyConverter/app/src/main/res/layout/fragment_rate.xml:10: error: duplicate attribute.

Command: /home/sparker0i/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/d811e9cf0b30534b0c407565dcc71d36/aapt2-3.2.1-4818971-linux/aapt2 compile --legacy
-o
/home/sparker0i/CurrencyConverter/app/build/intermediates/res/merged/debug
/home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-linux Daemon #2
at java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1006)
at com.android.ide.common.workers.ExecutorServiceAdapter.close(ExecutorServiceAdapter.kt:56)
at com.android.build.gradle.internal.aapt.WorkerExecutorResourceCompilationService.close(WorkerExecutorResourceCompilationService.kt:67)
at com.android.build.gradle.tasks.MergeResources.doFullTaskAction(MergeResources.java:324)
at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:106)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
... 43 more
Caused by: com.android.builder.internal.aapt.v2.Aapt2Exception: Failed to compile android resource '/home/sparker0i/CurrencyConverter/app/src/main/res/layout/fragment_rate.xml'.
Output: /home/sparker0i/CurrencyConverter/app/src/main/res/layout/fragment_rate.xml:10: error: duplicate attribute.

Command: /home/sparker0i/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/d811e9cf0b30534b0c407565dcc71d36/aapt2-3.2.1-4818971-linux/aapt2 compile --legacy
-o
/home/sparker0i/CurrencyConverter/app/build/intermediates/res/merged/debug
/home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-linux Daemon #2
at com.android.build.gradle.internal.res.Aapt2ErrorUtils.rewriteCompileException(Aapt2ErrorUtils.kt:44)
at com.android.build.gradle.internal.res.Aapt2CompileWithBlameRunnable$run$1.invoke(Aapt2CompileWithBlameRunnable.kt:39)
at com.android.build.gradle.internal.res.Aapt2CompileWithBlameRunnable$run$1.invoke(Aapt2CompileWithBlameRunnable.kt:28)
at com.android.build.gradle.internal.res.namespaced.Aapt2DaemonManagerService.useAaptDaemon(Aapt2DaemonManagerService.kt:71)
at com.android.build.gradle.internal.res.namespaced.Aapt2DaemonManagerService.useAaptDaemon$default(Aapt2DaemonManagerService.kt:69)
at com.android.build.gradle.internal.res.Aapt2CompileWithBlameRunnable.run(Aapt2CompileWithBlameRunnable.kt:34)
at com.android.ide.common.workers.ExecutorServiceAdapter$submit$submission$1.run(ExecutorServiceAdapter.kt:39)
at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource compilation failed
Output: /home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml:10: error: duplicate attribute.

Command: /home/sparker0i/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/d811e9cf0b30534b0c407565dcc71d36/aapt2-3.2.1-4818971-linux/aapt2 compile --legacy
-o
/home/sparker0i/CurrencyConverter/app/build/intermediates/res/merged/debug
/home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-linux Daemon #2
at com.android.builder.internal.aapt.v2.Aapt2DaemonImpl.doCompile(Aapt2DaemonImpl.kt:142)
at com.android.builder.internal.aapt.v2.Aapt2Daemon.compile(Aapt2Daemon.kt:81)
at com.android.builder.internal.aapt.v2.Aapt2DaemonManager$LeasedAaptDaemon.compile(Aapt2DaemonManager.kt:170)
at com.android.build.gradle.internal.res.Aapt2CompileWithBlameRunnable$run$1.invoke(Aapt2CompileWithBlameRunnable.kt:37)
... 10 more


EDIT2: Opened the layout file from the build folder:



<?xml version="1.0" encoding="utf-8"?>






<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent" android:tag="layout/fragment_rate_0" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" tools:context=".view.ui.RateFragment" android:layout_height="match_parent">
</FrameLayout>









share|improve this question
























  • Could you open the XML as indicated in the filepath? (e.g. /home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml)

    – Edric
    Nov 4 '18 at 16:40












  • Yes, check EDIT2. I don't know why the height and width parameters are being generated again @Edric

    – Sparker0i
    Nov 4 '18 at 16:54

















0















Following is my fragment_rate.xml layout XML file:



<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
tools:context=".view.ui.RateFragment"
android:layout_height="match_parent">
<FrameLayout
android:layout_height="match_parent"
android:layout_width="match_parent">
</FrameLayout>
</layout>


When I compile this, I have this particular error:



Android resource compilation failed
Output: /home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml:10: error: duplicate attribute.

Command: /home/sparker0i/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/d811e9cf0b30534b0c407565dcc71d36/aapt2-3.2.1-4818971-linux/aapt2 compile --legacy
-o
/home/sparker0i/CurrencyConverter/app/build/intermediates/res/merged/debug
/home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-linux Daemon #0


From this error message, line 10 resolves to the layout_width reference inside the FrameLayout. The strange fact is, when I swap the references of layout_height and layout_width, I still get the same error at line 10.



If there were a duplicate error, I should have got the error message on line 9 when I interchanged, but the error was still at line 10.



Please do help me.



PS. As strange as it sounds, there is also another user facing a similar issue here



EDIT1: Here is a more detailed error log:



org.gradle.internal.UncheckedException: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Failed to compile android resource '/home/sparker0i/CurrencyConverter/app/src/main/res/layout/fragment_rate.xml'.
Output: /home/sparker0i/CurrencyConverter/app/src/main/res/layout/fragment_rate.xml:10: error: duplicate attribute.

Command: /home/sparker0i/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/d811e9cf0b30534b0c407565dcc71d36/aapt2-3.2.1-4818971-linux/aapt2 compile --legacy
-o
/home/sparker0i/CurrencyConverter/app/build/intermediates/res/merged/debug
/home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-linux Daemon #2
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)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:113)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:95)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:256)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:249)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:238)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:663)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:597)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Failed to compile android resource '/home/sparker0i/CurrencyConverter/app/src/main/res/layout/fragment_rate.xml'.
Output: /home/sparker0i/CurrencyConverter/app/src/main/res/layout/fragment_rate.xml:10: error: duplicate attribute.

Command: /home/sparker0i/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/d811e9cf0b30534b0c407565dcc71d36/aapt2-3.2.1-4818971-linux/aapt2 compile --legacy
-o
/home/sparker0i/CurrencyConverter/app/build/intermediates/res/merged/debug
/home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-linux Daemon #2
at java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1006)
at com.android.ide.common.workers.ExecutorServiceAdapter.close(ExecutorServiceAdapter.kt:56)
at com.android.build.gradle.internal.aapt.WorkerExecutorResourceCompilationService.close(WorkerExecutorResourceCompilationService.kt:67)
at com.android.build.gradle.tasks.MergeResources.doFullTaskAction(MergeResources.java:324)
at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:106)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
... 43 more
Caused by: com.android.builder.internal.aapt.v2.Aapt2Exception: Failed to compile android resource '/home/sparker0i/CurrencyConverter/app/src/main/res/layout/fragment_rate.xml'.
Output: /home/sparker0i/CurrencyConverter/app/src/main/res/layout/fragment_rate.xml:10: error: duplicate attribute.

Command: /home/sparker0i/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/d811e9cf0b30534b0c407565dcc71d36/aapt2-3.2.1-4818971-linux/aapt2 compile --legacy
-o
/home/sparker0i/CurrencyConverter/app/build/intermediates/res/merged/debug
/home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-linux Daemon #2
at com.android.build.gradle.internal.res.Aapt2ErrorUtils.rewriteCompileException(Aapt2ErrorUtils.kt:44)
at com.android.build.gradle.internal.res.Aapt2CompileWithBlameRunnable$run$1.invoke(Aapt2CompileWithBlameRunnable.kt:39)
at com.android.build.gradle.internal.res.Aapt2CompileWithBlameRunnable$run$1.invoke(Aapt2CompileWithBlameRunnable.kt:28)
at com.android.build.gradle.internal.res.namespaced.Aapt2DaemonManagerService.useAaptDaemon(Aapt2DaemonManagerService.kt:71)
at com.android.build.gradle.internal.res.namespaced.Aapt2DaemonManagerService.useAaptDaemon$default(Aapt2DaemonManagerService.kt:69)
at com.android.build.gradle.internal.res.Aapt2CompileWithBlameRunnable.run(Aapt2CompileWithBlameRunnable.kt:34)
at com.android.ide.common.workers.ExecutorServiceAdapter$submit$submission$1.run(ExecutorServiceAdapter.kt:39)
at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource compilation failed
Output: /home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml:10: error: duplicate attribute.

Command: /home/sparker0i/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/d811e9cf0b30534b0c407565dcc71d36/aapt2-3.2.1-4818971-linux/aapt2 compile --legacy
-o
/home/sparker0i/CurrencyConverter/app/build/intermediates/res/merged/debug
/home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-linux Daemon #2
at com.android.builder.internal.aapt.v2.Aapt2DaemonImpl.doCompile(Aapt2DaemonImpl.kt:142)
at com.android.builder.internal.aapt.v2.Aapt2Daemon.compile(Aapt2Daemon.kt:81)
at com.android.builder.internal.aapt.v2.Aapt2DaemonManager$LeasedAaptDaemon.compile(Aapt2DaemonManager.kt:170)
at com.android.build.gradle.internal.res.Aapt2CompileWithBlameRunnable$run$1.invoke(Aapt2CompileWithBlameRunnable.kt:37)
... 10 more


EDIT2: Opened the layout file from the build folder:



<?xml version="1.0" encoding="utf-8"?>






<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent" android:tag="layout/fragment_rate_0" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" tools:context=".view.ui.RateFragment" android:layout_height="match_parent">
</FrameLayout>









share|improve this question
























  • Could you open the XML as indicated in the filepath? (e.g. /home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml)

    – Edric
    Nov 4 '18 at 16:40












  • Yes, check EDIT2. I don't know why the height and width parameters are being generated again @Edric

    – Sparker0i
    Nov 4 '18 at 16:54













0












0








0








Following is my fragment_rate.xml layout XML file:



<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
tools:context=".view.ui.RateFragment"
android:layout_height="match_parent">
<FrameLayout
android:layout_height="match_parent"
android:layout_width="match_parent">
</FrameLayout>
</layout>


When I compile this, I have this particular error:



Android resource compilation failed
Output: /home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml:10: error: duplicate attribute.

Command: /home/sparker0i/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/d811e9cf0b30534b0c407565dcc71d36/aapt2-3.2.1-4818971-linux/aapt2 compile --legacy
-o
/home/sparker0i/CurrencyConverter/app/build/intermediates/res/merged/debug
/home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-linux Daemon #0


From this error message, line 10 resolves to the layout_width reference inside the FrameLayout. The strange fact is, when I swap the references of layout_height and layout_width, I still get the same error at line 10.



If there were a duplicate error, I should have got the error message on line 9 when I interchanged, but the error was still at line 10.



Please do help me.



PS. As strange as it sounds, there is also another user facing a similar issue here



EDIT1: Here is a more detailed error log:



org.gradle.internal.UncheckedException: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Failed to compile android resource '/home/sparker0i/CurrencyConverter/app/src/main/res/layout/fragment_rate.xml'.
Output: /home/sparker0i/CurrencyConverter/app/src/main/res/layout/fragment_rate.xml:10: error: duplicate attribute.

Command: /home/sparker0i/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/d811e9cf0b30534b0c407565dcc71d36/aapt2-3.2.1-4818971-linux/aapt2 compile --legacy
-o
/home/sparker0i/CurrencyConverter/app/build/intermediates/res/merged/debug
/home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-linux Daemon #2
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)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:113)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:95)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:256)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:249)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:238)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:663)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:597)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Failed to compile android resource '/home/sparker0i/CurrencyConverter/app/src/main/res/layout/fragment_rate.xml'.
Output: /home/sparker0i/CurrencyConverter/app/src/main/res/layout/fragment_rate.xml:10: error: duplicate attribute.

Command: /home/sparker0i/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/d811e9cf0b30534b0c407565dcc71d36/aapt2-3.2.1-4818971-linux/aapt2 compile --legacy
-o
/home/sparker0i/CurrencyConverter/app/build/intermediates/res/merged/debug
/home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-linux Daemon #2
at java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1006)
at com.android.ide.common.workers.ExecutorServiceAdapter.close(ExecutorServiceAdapter.kt:56)
at com.android.build.gradle.internal.aapt.WorkerExecutorResourceCompilationService.close(WorkerExecutorResourceCompilationService.kt:67)
at com.android.build.gradle.tasks.MergeResources.doFullTaskAction(MergeResources.java:324)
at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:106)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
... 43 more
Caused by: com.android.builder.internal.aapt.v2.Aapt2Exception: Failed to compile android resource '/home/sparker0i/CurrencyConverter/app/src/main/res/layout/fragment_rate.xml'.
Output: /home/sparker0i/CurrencyConverter/app/src/main/res/layout/fragment_rate.xml:10: error: duplicate attribute.

Command: /home/sparker0i/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/d811e9cf0b30534b0c407565dcc71d36/aapt2-3.2.1-4818971-linux/aapt2 compile --legacy
-o
/home/sparker0i/CurrencyConverter/app/build/intermediates/res/merged/debug
/home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-linux Daemon #2
at com.android.build.gradle.internal.res.Aapt2ErrorUtils.rewriteCompileException(Aapt2ErrorUtils.kt:44)
at com.android.build.gradle.internal.res.Aapt2CompileWithBlameRunnable$run$1.invoke(Aapt2CompileWithBlameRunnable.kt:39)
at com.android.build.gradle.internal.res.Aapt2CompileWithBlameRunnable$run$1.invoke(Aapt2CompileWithBlameRunnable.kt:28)
at com.android.build.gradle.internal.res.namespaced.Aapt2DaemonManagerService.useAaptDaemon(Aapt2DaemonManagerService.kt:71)
at com.android.build.gradle.internal.res.namespaced.Aapt2DaemonManagerService.useAaptDaemon$default(Aapt2DaemonManagerService.kt:69)
at com.android.build.gradle.internal.res.Aapt2CompileWithBlameRunnable.run(Aapt2CompileWithBlameRunnable.kt:34)
at com.android.ide.common.workers.ExecutorServiceAdapter$submit$submission$1.run(ExecutorServiceAdapter.kt:39)
at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource compilation failed
Output: /home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml:10: error: duplicate attribute.

Command: /home/sparker0i/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/d811e9cf0b30534b0c407565dcc71d36/aapt2-3.2.1-4818971-linux/aapt2 compile --legacy
-o
/home/sparker0i/CurrencyConverter/app/build/intermediates/res/merged/debug
/home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-linux Daemon #2
at com.android.builder.internal.aapt.v2.Aapt2DaemonImpl.doCompile(Aapt2DaemonImpl.kt:142)
at com.android.builder.internal.aapt.v2.Aapt2Daemon.compile(Aapt2Daemon.kt:81)
at com.android.builder.internal.aapt.v2.Aapt2DaemonManager$LeasedAaptDaemon.compile(Aapt2DaemonManager.kt:170)
at com.android.build.gradle.internal.res.Aapt2CompileWithBlameRunnable$run$1.invoke(Aapt2CompileWithBlameRunnable.kt:37)
... 10 more


EDIT2: Opened the layout file from the build folder:



<?xml version="1.0" encoding="utf-8"?>






<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent" android:tag="layout/fragment_rate_0" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" tools:context=".view.ui.RateFragment" android:layout_height="match_parent">
</FrameLayout>









share|improve this question
















Following is my fragment_rate.xml layout XML file:



<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
tools:context=".view.ui.RateFragment"
android:layout_height="match_parent">
<FrameLayout
android:layout_height="match_parent"
android:layout_width="match_parent">
</FrameLayout>
</layout>


When I compile this, I have this particular error:



Android resource compilation failed
Output: /home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml:10: error: duplicate attribute.

Command: /home/sparker0i/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/d811e9cf0b30534b0c407565dcc71d36/aapt2-3.2.1-4818971-linux/aapt2 compile --legacy
-o
/home/sparker0i/CurrencyConverter/app/build/intermediates/res/merged/debug
/home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-linux Daemon #0


From this error message, line 10 resolves to the layout_width reference inside the FrameLayout. The strange fact is, when I swap the references of layout_height and layout_width, I still get the same error at line 10.



If there were a duplicate error, I should have got the error message on line 9 when I interchanged, but the error was still at line 10.



Please do help me.



PS. As strange as it sounds, there is also another user facing a similar issue here



EDIT1: Here is a more detailed error log:



org.gradle.internal.UncheckedException: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Failed to compile android resource '/home/sparker0i/CurrencyConverter/app/src/main/res/layout/fragment_rate.xml'.
Output: /home/sparker0i/CurrencyConverter/app/src/main/res/layout/fragment_rate.xml:10: error: duplicate attribute.

Command: /home/sparker0i/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/d811e9cf0b30534b0c407565dcc71d36/aapt2-3.2.1-4818971-linux/aapt2 compile --legacy
-o
/home/sparker0i/CurrencyConverter/app/build/intermediates/res/merged/debug
/home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-linux Daemon #2
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)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:113)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:95)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:256)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:249)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:238)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:663)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:597)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Failed to compile android resource '/home/sparker0i/CurrencyConverter/app/src/main/res/layout/fragment_rate.xml'.
Output: /home/sparker0i/CurrencyConverter/app/src/main/res/layout/fragment_rate.xml:10: error: duplicate attribute.

Command: /home/sparker0i/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/d811e9cf0b30534b0c407565dcc71d36/aapt2-3.2.1-4818971-linux/aapt2 compile --legacy
-o
/home/sparker0i/CurrencyConverter/app/build/intermediates/res/merged/debug
/home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-linux Daemon #2
at java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1006)
at com.android.ide.common.workers.ExecutorServiceAdapter.close(ExecutorServiceAdapter.kt:56)
at com.android.build.gradle.internal.aapt.WorkerExecutorResourceCompilationService.close(WorkerExecutorResourceCompilationService.kt:67)
at com.android.build.gradle.tasks.MergeResources.doFullTaskAction(MergeResources.java:324)
at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:106)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
... 43 more
Caused by: com.android.builder.internal.aapt.v2.Aapt2Exception: Failed to compile android resource '/home/sparker0i/CurrencyConverter/app/src/main/res/layout/fragment_rate.xml'.
Output: /home/sparker0i/CurrencyConverter/app/src/main/res/layout/fragment_rate.xml:10: error: duplicate attribute.

Command: /home/sparker0i/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/d811e9cf0b30534b0c407565dcc71d36/aapt2-3.2.1-4818971-linux/aapt2 compile --legacy
-o
/home/sparker0i/CurrencyConverter/app/build/intermediates/res/merged/debug
/home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-linux Daemon #2
at com.android.build.gradle.internal.res.Aapt2ErrorUtils.rewriteCompileException(Aapt2ErrorUtils.kt:44)
at com.android.build.gradle.internal.res.Aapt2CompileWithBlameRunnable$run$1.invoke(Aapt2CompileWithBlameRunnable.kt:39)
at com.android.build.gradle.internal.res.Aapt2CompileWithBlameRunnable$run$1.invoke(Aapt2CompileWithBlameRunnable.kt:28)
at com.android.build.gradle.internal.res.namespaced.Aapt2DaemonManagerService.useAaptDaemon(Aapt2DaemonManagerService.kt:71)
at com.android.build.gradle.internal.res.namespaced.Aapt2DaemonManagerService.useAaptDaemon$default(Aapt2DaemonManagerService.kt:69)
at com.android.build.gradle.internal.res.Aapt2CompileWithBlameRunnable.run(Aapt2CompileWithBlameRunnable.kt:34)
at com.android.ide.common.workers.ExecutorServiceAdapter$submit$submission$1.run(ExecutorServiceAdapter.kt:39)
at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource compilation failed
Output: /home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml:10: error: duplicate attribute.

Command: /home/sparker0i/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/d811e9cf0b30534b0c407565dcc71d36/aapt2-3.2.1-4818971-linux/aapt2 compile --legacy
-o
/home/sparker0i/CurrencyConverter/app/build/intermediates/res/merged/debug
/home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml
Daemon: AAPT2 aapt2-3.2.1-4818971-linux Daemon #2
at com.android.builder.internal.aapt.v2.Aapt2DaemonImpl.doCompile(Aapt2DaemonImpl.kt:142)
at com.android.builder.internal.aapt.v2.Aapt2Daemon.compile(Aapt2Daemon.kt:81)
at com.android.builder.internal.aapt.v2.Aapt2DaemonManager$LeasedAaptDaemon.compile(Aapt2DaemonManager.kt:170)
at com.android.build.gradle.internal.res.Aapt2CompileWithBlameRunnable$run$1.invoke(Aapt2CompileWithBlameRunnable.kt:37)
... 10 more


EDIT2: Opened the layout file from the build folder:



<?xml version="1.0" encoding="utf-8"?>






<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent" android:tag="layout/fragment_rate_0" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" tools:context=".view.ui.RateFragment" android:layout_height="match_parent">
</FrameLayout>






android gradle kotlin






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 4 '18 at 16:52







Sparker0i

















asked Nov 4 '18 at 16:34









Sparker0iSparker0i

5541 gold badge11 silver badges32 bronze badges




5541 gold badge11 silver badges32 bronze badges












  • Could you open the XML as indicated in the filepath? (e.g. /home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml)

    – Edric
    Nov 4 '18 at 16:40












  • Yes, check EDIT2. I don't know why the height and width parameters are being generated again @Edric

    – Sparker0i
    Nov 4 '18 at 16:54

















  • Could you open the XML as indicated in the filepath? (e.g. /home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml)

    – Edric
    Nov 4 '18 at 16:40












  • Yes, check EDIT2. I don't know why the height and width parameters are being generated again @Edric

    – Sparker0i
    Nov 4 '18 at 16:54
















Could you open the XML as indicated in the filepath? (e.g. /home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml)

– Edric
Nov 4 '18 at 16:40






Could you open the XML as indicated in the filepath? (e.g. /home/sparker0i/CurrencyConverter/app/build/intermediates/incremental/mergeDebugResources/stripped.dir/layout/fragment_rate.xml)

– Edric
Nov 4 '18 at 16:40














Yes, check EDIT2. I don't know why the height and width parameters are being generated again @Edric

– Sparker0i
Nov 4 '18 at 16:54





Yes, check EDIT2. I don't know why the height and width parameters are being generated again @Edric

– Sparker0i
Nov 4 '18 at 16:54












3 Answers
3






active

oldest

votes


















1














After researching on the <layout> tag, it appears to me that this tag is used for Data Binding as asked before here (about the usage of the <layout> tag) and is explained in more detail at the Android Developers documentation (about how to use such tags).



So I'm what assuming here is that the properties in the <layout> tag are probably being internally passed down to the parent tag (which is <FrameLayout> in your case).




So, either you remove the <layout> tag and reassign those properties to the <FrameLayout> tag if you're not using Data Binding, or just remove all of the properties except the XML namespaces (or the xmlns attributes).






share|improve this answer























  • Yup, this fixes it for me. Thanks

    – Sparker0i
    Nov 4 '18 at 19:25


















1














In my case I have given id to <layout> tag by mistake. After Removing that, problem is resolved.



<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/layout">

<android.support.constraint.ConstraintLayout
android:id="@+id/cm1"
android:layout_width="match_parent"
android:layout_height="match_parent">





share|improve this answer























  • This helped me. But I had that id there for a WEEK and it wasn't a problem, it started crying after week.

    – Matej Košút
    Jun 13 at 10:45


















0














I was able to fix the problem by removing both android:layout_width and android:layout_height attributes.






share|improve this answer



























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53142936%2fandroid-resource-compilation-failed-even-after-swapping-attributes%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    After researching on the <layout> tag, it appears to me that this tag is used for Data Binding as asked before here (about the usage of the <layout> tag) and is explained in more detail at the Android Developers documentation (about how to use such tags).



    So I'm what assuming here is that the properties in the <layout> tag are probably being internally passed down to the parent tag (which is <FrameLayout> in your case).




    So, either you remove the <layout> tag and reassign those properties to the <FrameLayout> tag if you're not using Data Binding, or just remove all of the properties except the XML namespaces (or the xmlns attributes).






    share|improve this answer























    • Yup, this fixes it for me. Thanks

      – Sparker0i
      Nov 4 '18 at 19:25















    1














    After researching on the <layout> tag, it appears to me that this tag is used for Data Binding as asked before here (about the usage of the <layout> tag) and is explained in more detail at the Android Developers documentation (about how to use such tags).



    So I'm what assuming here is that the properties in the <layout> tag are probably being internally passed down to the parent tag (which is <FrameLayout> in your case).




    So, either you remove the <layout> tag and reassign those properties to the <FrameLayout> tag if you're not using Data Binding, or just remove all of the properties except the XML namespaces (or the xmlns attributes).






    share|improve this answer























    • Yup, this fixes it for me. Thanks

      – Sparker0i
      Nov 4 '18 at 19:25













    1












    1








    1







    After researching on the <layout> tag, it appears to me that this tag is used for Data Binding as asked before here (about the usage of the <layout> tag) and is explained in more detail at the Android Developers documentation (about how to use such tags).



    So I'm what assuming here is that the properties in the <layout> tag are probably being internally passed down to the parent tag (which is <FrameLayout> in your case).




    So, either you remove the <layout> tag and reassign those properties to the <FrameLayout> tag if you're not using Data Binding, or just remove all of the properties except the XML namespaces (or the xmlns attributes).






    share|improve this answer













    After researching on the <layout> tag, it appears to me that this tag is used for Data Binding as asked before here (about the usage of the <layout> tag) and is explained in more detail at the Android Developers documentation (about how to use such tags).



    So I'm what assuming here is that the properties in the <layout> tag are probably being internally passed down to the parent tag (which is <FrameLayout> in your case).




    So, either you remove the <layout> tag and reassign those properties to the <FrameLayout> tag if you're not using Data Binding, or just remove all of the properties except the XML namespaces (or the xmlns attributes).







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 4 '18 at 17:54









    EdricEdric

    9,0637 gold badges39 silver badges52 bronze badges




    9,0637 gold badges39 silver badges52 bronze badges












    • Yup, this fixes it for me. Thanks

      – Sparker0i
      Nov 4 '18 at 19:25

















    • Yup, this fixes it for me. Thanks

      – Sparker0i
      Nov 4 '18 at 19:25
















    Yup, this fixes it for me. Thanks

    – Sparker0i
    Nov 4 '18 at 19:25





    Yup, this fixes it for me. Thanks

    – Sparker0i
    Nov 4 '18 at 19:25













    1














    In my case I have given id to <layout> tag by mistake. After Removing that, problem is resolved.



    <layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/layout">

    <android.support.constraint.ConstraintLayout
    android:id="@+id/cm1"
    android:layout_width="match_parent"
    android:layout_height="match_parent">





    share|improve this answer























    • This helped me. But I had that id there for a WEEK and it wasn't a problem, it started crying after week.

      – Matej Košút
      Jun 13 at 10:45















    1














    In my case I have given id to <layout> tag by mistake. After Removing that, problem is resolved.



    <layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/layout">

    <android.support.constraint.ConstraintLayout
    android:id="@+id/cm1"
    android:layout_width="match_parent"
    android:layout_height="match_parent">





    share|improve this answer























    • This helped me. But I had that id there for a WEEK and it wasn't a problem, it started crying after week.

      – Matej Košút
      Jun 13 at 10:45













    1












    1








    1







    In my case I have given id to <layout> tag by mistake. After Removing that, problem is resolved.



    <layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/layout">

    <android.support.constraint.ConstraintLayout
    android:id="@+id/cm1"
    android:layout_width="match_parent"
    android:layout_height="match_parent">





    share|improve this answer













    In my case I have given id to <layout> tag by mistake. After Removing that, problem is resolved.



    <layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/layout">

    <android.support.constraint.ConstraintLayout
    android:id="@+id/cm1"
    android:layout_width="match_parent"
    android:layout_height="match_parent">






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Mar 26 at 5:53









    Abhay KoradiyaAbhay Koradiya

    9351 gold badge7 silver badges25 bronze badges




    9351 gold badge7 silver badges25 bronze badges












    • This helped me. But I had that id there for a WEEK and it wasn't a problem, it started crying after week.

      – Matej Košút
      Jun 13 at 10:45

















    • This helped me. But I had that id there for a WEEK and it wasn't a problem, it started crying after week.

      – Matej Košút
      Jun 13 at 10:45
















    This helped me. But I had that id there for a WEEK and it wasn't a problem, it started crying after week.

    – Matej Košút
    Jun 13 at 10:45





    This helped me. But I had that id there for a WEEK and it wasn't a problem, it started crying after week.

    – Matej Košút
    Jun 13 at 10:45











    0














    I was able to fix the problem by removing both android:layout_width and android:layout_height attributes.






    share|improve this answer





























      0














      I was able to fix the problem by removing both android:layout_width and android:layout_height attributes.






      share|improve this answer



























        0












        0








        0







        I was able to fix the problem by removing both android:layout_width and android:layout_height attributes.






        share|improve this answer















        I was able to fix the problem by removing both android:layout_width and android:layout_height attributes.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Apr 12 at 7:34









        M. R.

        2,6507 gold badges16 silver badges38 bronze badges




        2,6507 gold badges16 silver badges38 bronze badges










        answered Apr 12 at 6:38









        MohsenMohsen

        145 bronze badges




        145 bronze badges



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53142936%2fandroid-resource-compilation-failed-even-after-swapping-attributes%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현