title: Error:In <declare-styleable> - unable to find attribute
body: <p>I'm getting Gradle errors for missing attributes when trying to build my project;</p>
  
  <p><code>Error:In &lt;declare-styleable&gt; ReflowText, unable to find attribute maxDuration</code></p>
  
  <p>and </p>
  
  <p><code>Error:In &lt;declare-styleable&gt; ReflowText, unable to find attribute velocity</code></p>
  
  <p>I've just attempted to implement <a href="https://github.com/nickbutcher/plaid/blob/master/app/src/main/java/io/plaidapp/ui/transitions/ReflowText.java" rel="nofollow noreferrer"><code>ReflowText</code></a> in my project. The <code>ReflowText</code> class has been copy &amp; pasted from the above link with no changes (except for package name) and I have copied the associated required attributes;</p>
  
  <p><a href="https://github.com/nickbutcher/plaid/blob/master/app/src/main/res/values/attrs_reflow_text.xml" rel="nofollow noreferrer"><strong><code>res/values/attrs_reflow_text.xml</code></strong></a>
      </p>
  
  <pre><code>&lt;resources&gt;
  
      &lt;declare-styleable name="ReflowText"&gt;
          &lt;attr name="velocity" /&gt;
          &lt;attr name="minDuration" /&gt;
          &lt;attr name="maxDuration" /&gt;
          &lt;attr name="staggerDelay" format="integer" /&gt;
          &lt;attr name="freezeFrame" format="boolean" /&gt;
      &lt;/declare-styleable&gt;
  
  &lt;/resources&gt;
  </code></pre>
  
  <p>I cannot work out why I am getting a build error. I have looked at various other SO questions with similar errors but none of the answers on them seem to address my issue;</p>
  
  <ul>
  <li><p><a href="https://stackoverflow.com/questions/29248579/error-in-declare-styleable-menuview-unable-to-find-attribute-androidpreserv">ERROR: In  MenuView, unable to find attribute android:preserveIconSpacing</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/33081854/error-declare-styleable-menuview-unable-to-find-attribute-androidpreserveico">error  MenuView, unable to find attribute android:preserveIconSpacing</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/29726125/errorin-declare-styleable-sherlockspinner-unable-to-find-attribute-androidp">Error:In  SherlockSpinner, unable to find attribute android:popupPromptView</a></p></li>
  </ul>
  
  <p>My full Gradle Console output is;</p>
  
  <pre><code>Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:compileDebugSources, :app:compileDebugAndroidTestSources, :app:compileDebugUnitTestSources]
  
  Configuration on demand is an incubating feature.
  NDK is missing a "platforms" directory.
  If you are using NDK, verify the ndk.dir is set to a valid NDK directory.  It is currently set to C:\Users\Jonny Wright\AppData\Local\Android\Sdk\ndk-bundle.
  If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.
  
  :app:preBuild UP-TO-DATE
  :app:preDebugBuild UP-TO-DATE
  :app:checkDebugManifest
  :app:preReleaseBuild UP-TO-DATE
  :app:prepareComAndroidDatabindingAdapters131Library
  :app:prepareComAndroidDatabindingLibrary131Library
  :app:prepareComAndroidSupportAnimatedVectorDrawable2511Library
  :app:prepareComAndroidSupportAppcompatV72511Library
  :app:prepareComAndroidSupportCardviewV72510Library
  :app:prepareComAndroidSupportConstraintConstraintLayout100Beta4Library
  :app:prepareComAndroidSupportCustomtabs2510Library
  :app:prepareComAndroidSupportDesign2511Library
  :app:prepareComAndroidSupportPaletteV72511Library
  :app:prepareComAndroidSupportRecyclerviewV72511Library
  :app:prepareComAndroidSupportSupportCompat2511Library
  :app:prepareComAndroidSupportSupportCoreUi2511Library
  :app:prepareComAndroidSupportSupportCoreUtils2511Library
  :app:prepareComAndroidSupportSupportFragment2511Library
  :app:prepareComAndroidSupportSupportMediaCompat2511Library
  :app:prepareComAndroidSupportSupportV42511Library
  :app:prepareComAndroidSupportSupportVectorDrawable2511Library
  :app:prepareComAndroidSupportTransition2511Library
  :app:prepareComBignerdranchAndroidExpandablerecyclerview300RC1Library
  :app:prepareComFacebookAndroidFacebookAndroidSdk4180Library
  :app:prepareComFirebaseuiFirebaseUi111Library
  :app:prepareComFirebaseuiFirebaseUiAuth111Library
  :app:prepareComFirebaseuiFirebaseUiDatabase111Library
  :app:prepareComFirebaseuiFirebaseUiStorage111Library
  :app:prepareComGithubClansFab164Library
  :app:prepareComGoogleAndroidGmsPlayServicesAuth1001Library
  :app:prepareComGoogleAndroidGmsPlayServicesAuthBase1001Library
  :app:prepareComGoogleAndroidGmsPlayServicesBase1001Library
  :app:prepareComGoogleAndroidGmsPlayServicesBasement1001Library
  :app:prepareComGoogleAndroidGmsPlayServicesTasks1001Library
  :app:prepareComGoogleFirebaseFirebaseAnalytics1001Library
  :app:prepareComGoogleFirebaseFirebaseAnalyticsImpl1001Library
  :app:prepareComGoogleFirebaseFirebaseAuth1001Library
  :app:prepareComGoogleFirebaseFirebaseCommon1001Library
  :app:prepareComGoogleFirebaseFirebaseCore1001Library
  :app:prepareComGoogleFirebaseFirebaseDatabase1001Library
  :app:prepareComGoogleFirebaseFirebaseDatabaseConnection1001Library
  :app:prepareComGoogleFirebaseFirebaseIid1001Library
  :app:prepareComGoogleFirebaseFirebaseStorage1001Library
  :app:prepareComGoogleFirebaseFirebaseStorageCommon1001Library
  :app:prepareComJakewhartonButterknife851Library
  :app:prepareComTwitterSdkAndroidTweetComposer230Library
  :app:prepareComTwitterSdkAndroidTweetUi230Library
  :app:prepareComTwitterSdkAndroidTwitter230Library
  :app:prepareComTwitterSdkAndroidTwitterCore230Library
  :app:prepareIoFabricSdkAndroidFabric1314Library
  :app:prepareDebugDependencies
  :app:compileDebugAidl UP-TO-DATE
  :app:compileDebugRenderscript UP-TO-DATE
  :app:generateDebugBuildConfig UP-TO-DATE
  :app:generateDebugResValues UP-TO-DATE
  :app:processDebugGoogleServices
  Parsing json file: C:\Android\traffitool\app\google-services.json
  :app:generateDebugResources
  :app:mergeDebugResources UP-TO-DATE
  :app:dataBindingProcessLayoutsDebug UP-TO-DATE
  :app:processDebugManifest UP-TO-DATE
  :app:processDebugResources
  ERROR: In &lt;declare-styleable&gt; ReflowText, unable to find attribute maxDuration
  ERROR: In &lt;declare-styleable&gt; ReflowText, unable to find attribute minDuration
  ERROR: In &lt;declare-styleable&gt; ReflowText, unable to find attribute velocity
  
  
   FAILED
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':app:processDebugResources'.
  &gt; com.android.ide.common.process.ProcessException: Failed to execute aapt
  
  * Try:
  Run with --info or --debug option to get more log output.
  
  * Exception is:
  org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:processDebugResources'.
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:84)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:55)
      at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
      at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
      at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
      at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:46)
      at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
      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.execute(DefaultTaskGraphExecuter.java:236)
      at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:228)
      at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
      at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
      at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61)
      at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:228)
      at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215)
      at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:77)
      at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:58)
      at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:32)
      at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:113)
      at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
      at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
      at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
      at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
      at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
      at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
      at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
      at org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:196)
      at org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:193)
      at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
      at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
      at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56)
      at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:193)
      at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:119)
      at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:102)
      at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:71)
      at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:50)
      at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
      at org.gradle.tooling.internal.provider.runner.RunAsBuildOperationBuildActionRunner$1.execute(RunAsBuildOperationBuildActionRunner.java:43)
      at org.gradle.tooling.internal.provider.runner.RunAsBuildOperationBuildActionRunner$1.execute(RunAsBuildOperationBuildActionRunner.java:40)
      at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
      at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
      at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56)
      at org.gradle.tooling.internal.provider.runner.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40)
      at org.gradle.tooling.internal.provider.runner.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:75)
      at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
      at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41)
      at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
      at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
      at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49)
      at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:44)
      at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:29)
      at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
      at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
      at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
      at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:47)
      at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
      at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
      at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
      at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
      at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
      at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
      at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
      at org.gradle.util.Swapper.swap(Swapper.java:38)
      at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
      at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
      at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
      at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
      at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
      at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
      at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
      at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
      at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
      at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
      at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
      at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
      at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
      at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
  Caused by: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: Failed to execute aapt
      at com.android.build.gradle.tasks.ProcessAndroidResources.doFullTaskAction(ProcessAndroidResources.java:201)
      at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:82)
      at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
      at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:163)
      at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
      at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:123)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:95)
      at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:76)
      ... 78 more
  Caused by: com.android.ide.common.process.ProcessException: Failed to execute aapt
      at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:867)
      at com.android.build.gradle.tasks.ProcessAndroidResources.doFullTaskAction(ProcessAndroidResources.java:194)
      ... 85 more
  Caused by: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing process C:\Users\Jonny Wright\AppData\Local\Android\Sdk\build-tools\25.0.2\aapt.exe with arguments {package -f --no-crunch -I C:\Users\Jonny Wright\AppData\Local\Android\Sdk\platforms\android-25\android.jar -M \\?\C:\Android\traffitool\app\build\intermediates\manifests\full\debug\AndroidManifest.xml -S C:\Android\traffitool\app\build\intermediates\data-binding-layout-out\debug -m -J \\?\C:\Android\traffitool\app\build\generated\source\r\debug -F C:\Android\traffitool\app\build\intermediates\res\resources-debug.ap_ --debug-mode --custom-package io.traffitool -0 apk --output-text-symbols \\?\C:\Android\traffitool\app\build\intermediates\symbols\debug --no-version-vectors}
      at com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:299)
      at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:286)
      at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:116)
      at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:865)
      ... 86 more
  Caused by: com.android.ide.common.process.ProcessException: Error while executing process C:\Users\Jonny Wright\AppData\Local\Android\Sdk\build-tools\25.0.2\aapt.exe with arguments {package -f --no-crunch -I C:\Users\Jonny Wright\AppData\Local\Android\Sdk\platforms\android-25\android.jar -M \\?\C:\Android\traffitool\app\build\intermediates\manifests\full\debug\AndroidManifest.xml -S C:\Android\traffitool\app\build\intermediates\data-binding-layout-out\debug -m -J \\?\C:\Android\traffitool\app\build\generated\source\r\debug -F C:\Android\traffitool\app\build\intermediates\res\resources-debug.ap_ --debug-mode --custom-package io.traffitool -0 apk --output-text-symbols \\?\C:\Android\traffitool\app\build\intermediates\symbols\debug --no-version-vectors}
      at com.android.build.gradle.internal.process.GradleProcessResult.buildProcessException(GradleProcessResult.java:74)
      at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:49)
      at com.android.builder.internal.aapt.AbstractProcessExecutionAapt$1.onSuccess(AbstractProcessExecutionAapt.java:78)
      at com.android.builder.internal.aapt.AbstractProcessExecutionAapt$1.onSuccess(AbstractProcessExecutionAapt.java:74)
      at com.google.common.util.concurrent.Futures$6.run(Futures.java:1319)
      at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:457)
      at com.google.common.util.concurrent.ExecutionList.executeListener(ExecutionList.java:156)
      at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:145)
      at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:185)
      at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:53)
      at com.android.build.gradle.internal.process.GradleProcessExecutor$1.run(GradleProcessExecutor.java:60)
  Caused by: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Jonny Wright\AppData\Local\Android\Sdk\build-tools\25.0.2\aapt.exe'' finished with non-zero exit value 1
      at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:369)
      at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:47)
      ... 9 more
  
  
  BUILD FAILED
  
  Total time: 13.096 secs
  </code></pre>