title: Proguard, Cannot create an instance of class ViewModel kotlin
body: <p>I'm getting that error only when minifyEnabled is true (even with -dontobfuscate)</p>
  
  <pre><code>java.lang.RuntimeException: Cannot create an instance of class com.myapps.app.TracksVM
          at androidx.lifecycle.ViewModelProvider$AndroidViewModelFactory.create(ViewModelProvider.java:202)
          at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.java:135)
          at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.java:103)
          at com.myapps.app.MyFragment.onCreateView(MyFragment.kt:72)
  </code></pre>
  
  <p>ViewModelProvider.java:202 in the support library source refers to:</p>
  
  <pre><code>try {
                      return modelClass.getConstructor(Application.class).newInstance(mApplication);
                  } catch (NoSuchMethodException e) {
                      throw new RuntimeException("Cannot create an instance of " + modelClass, e);
                  }
  </code></pre>
  
  <p>Proguard probably removed a method or the constructor?</p>
  
  <p>Here's my proguard.pro:</p>
  
  <pre><code>-dontwarn okhttp3.**
  -dontwarn okio.**
  -dontwarn javax.annotation.**
  -dontwarn org.conscrypt.**
  -keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase
  -dontobfuscate
  </code></pre>
  
  <p>The ViewModel:</p>
  
  <pre><code>class TracksVM(application: Application) : AndroidViewModel(application) {
  ...
  }
  </code></pre>
  
  <p>And the Fragment:</p>
  
  <pre><code>class MyFragment : Fragment() {
      private lateinit var viewModel: TracksVM
  
      override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
          return inflater.inflate(R.layout.content_recents, container, false)
      }
  
      override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
          viewModel = ViewModelProviders.of(this).get(TracksVM::class.java)
      }
  }
  </code></pre>