title: Declaring a receiver in the manifest file of an android Studio project
body: <p>In my manifest file, I declare two <code>BroadcastReceiver</code> for my <code>Activity</code>. So far, while I was working in debug mode, the receivers were declared in the activity block and everything was fine. As my project is close to the end, I have decided to build an signed APK. The problem I face is that android studio returns me the following error :</p>
  
  <pre><code>Error:(20) Error: The &lt;receiver&gt; element must be a direct child of the &lt;application&gt; element [WrongManifestParent]
  </code></pre>
  
  <p>If I move the receivers blocks out of the activity block, the signed APK is generated. The consequence is that I get a runtime error when the receiver is called (java.lang.RuntimeException: Unable to instantiate receiver...).</p>
  
  <p>How can I do to have my app run correctly both in debug and release mode?</p>