title: ProGuard leads to NullPointerException
body: <p>When setting <code>minifyEnabled true</code> in my gradle I get a <em>NullPointerException</em> when starting my app:  </p>
  
  <pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{de.ae.formulaecalendar/de.ae.formulaecalendar.view.calendar.CalendarActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.RecyclerView.setLayoutManager(android.support.v7.widget.RecyclerView$LayoutManager)' on a null object reference
     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2444)
     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2504)
     at android.app.ActivityThread.-wrap11(ActivityThread.java)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1367)
     at android.os.Handler.dispatchMessage(Handler.java:102)
     at android.os.Looper.loop(Looper.java:148)
     at android.app.ActivityThread.main(ActivityThread.java:5461)
     at java.lang.reflect.Method.invoke(Native Method)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.RecyclerView.setLayoutManager(android.support.v7.widget.RecyclerView$LayoutManager)' on a null object reference
     at de.ae.formulaecalendar.view.calendar.CalendarActivity.onCreate(Unknown Source)
     at android.app.Activity.performCreate(Activity.java:6251)
     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2397)
     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2504) 
     at android.app.ActivityThread.-wrap11(ActivityThread.java) 
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1367) 
     at android.os.Handler.dispatchMessage(Handler.java:102) 
     at android.os.Looper.loop(Looper.java:148) 
     at android.app.ActivityThread.main(ActivityThread.java:5461) 
     at java.lang.reflect.Method.invoke(Native Method) 
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
  </code></pre>
  
  <p>While reading through StackOverflow I found some settings for the <em>proguard-rules.pro</em> file:  </p>
  
  <pre><code>######### KEEP ANDROID SUPPORT V7 AND DESIGN
  -keep class android.support.v7.** { *; }
  -keep interface android.support.v7.** { *; }
  </code></pre>
  
  <p>which didn't really solve this problem (but a previous NullPointerException).</p>
  
  <p>Finally the important part of my gradle:  </p>
  
  <pre><code>buildTypes {
      release {
          shrinkResources true
          minifyEnabled true
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          signingConfig signingConfigs.config
      }
  }
  </code></pre>
  
  <p>When I disbale <code>minifyEnabled</code> everthing works fine.</p>
  
  <p>Thanks for your help!</p>