title: Android Studio 3.0 Manifest Error: unknown element <action> found
body: <blockquote>
    <p><strong>NOTICE:</strong> Please do not post this <strong>"android.enableAapt2=false"</strong> as an answer. It is <strong>not</strong> a solution. It is just ignoring the real error which is not causing any problem on runtime. </p>
    
    <p><em>Solution was simple, just removed mistakenly placed <strong>action tag</strong> outside of an intent filter in the manifest file.</em></p>
  </blockquote>
  
  <p>Have an application which was building by Android Studio 2.3 fine.
  After updating Android Studio 3.0 <strong>Stable</strong>, started to having this error and unable to build my project.</p>
  
  <p>Here my manifest.xml</p>
  
  <pre><code>&lt;application
      android:name=".ApplicationClass"
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:largeHeap="true"
      android:supportsRtl="true"
      android:theme="@style/AppTheme"&gt;
  
      &lt;!--other unrelated stuff--&gt;
  
      &lt;action android:name="com.google.android.c2dm.intent.REGISTRATION" /&gt;
  
      &lt;receiver
          android:name="com.google.android.gms.gcm.GcmReceiver"
          android:exported="true"
          android:permission="com.google.android.c2dm.permission.SEND"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="com.google.android.c2dm.intent.RECEIVE" /&gt;
              &lt;category android:name="com.xxx.xxx" /&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p>Error shows this line:</p>
  
  <pre><code>&lt;action android:name="com.google.android.c2dm.intent.REGISTRATION" /&gt;
  </code></pre>
  
  <p>If I comment/remove this action tag line, the project builds fine but it is necessary for <code>GCM</code> and I cannot remove it.</p>
  
  <p>As you see the logs, The error <strong>not occurs at main</strong> manifest file, occurs at /build/intermediates/manifests/full/<strong>debug</strong>/AndroidManifest.xml</p>
  
  <p>Tried cleaning, rebuilding, disabling instant run. Is there any solution?</p>
  
  <p><strong>The Error Logs:</strong></p>
  
  <pre><code>/THE_PROJECT_PATH/app/build/intermediates/manifests/full/debug/AndroidManifest.xml
  Error:(99) error: unknown element &lt;action&gt; found.
  Error:(99) unknown element &lt;action&gt; found.
  Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
  Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
  Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
  Error:Execution failed for task ':app:processDebugResources'.
  &gt; Failed to execute aapt
  Information:BUILD FAILED in 1s
  Information:6 errors
  Information:0 warnings
  Information:See complete output in console
  </code></pre>