How do I convert an application project into library project?
<p>I know and completely aware of that I can create and integrate a library project in Android Studio with my main project.</p>

<p>My question is:</p>

<ol>
<li><p>Can I convert a fully functional Android application with lots of layouts, XMLs and view into Android Library Project?</p></li>
<li><p>If the answer is yes (I've already tried, it seems feasible). But I am confused about the Android Manifest of the library project as it was a manifest of an application. I am getting error like </p>

<blockquote>
  <p>Error:(1046) Attribute "orientation" has already been defined
  Error:Execution failed for task ':processDebugResources'.</p>
  
  <p>com.android.ide.common.process.ProcessException:
  org.gradle.process.internal.ExecException: Process 'command
  '/root/Android/Sdk/build-tools/22.0.1/aapt'' finished with non-zero
  exit value 1</p>
</blockquote></li>
<li><p>What changes should I make to successfully integrate this application as library with another application.
I am sensing it should be the manifests, removing the drawables, something like this?</p></li>
</ol>

<p>Or it is not possible? I have to recreate the library from scratch?</p>

<h2>Edit</h2>

<p>Following the suggested <a href="https://stackoverflow.com/questions/17614250/convert-existing-project-to-library-project-in-android-studio">link</a> give me the error</p>

<pre><code>Error:Execution failed for task ':transformClassesAndResourcesWithSyncLibJarsForDebug'.
&gt; error
</code></pre>