title: KOTLIN -> InstantiationException: Unable to instantiate fragment make sure class name exists, is public, and has an empty constructor that is public
body: <p>I am using kotlin in my android app and got this crash report:</p>
  
  <pre><code>android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment DetailsFragment: make sure class name exists, is public, and has an empty constructor that is public.
  </code></pre>
  
  <p>Here is my DetailsFragment class.</p>
  
  <pre><code>class DetailsFragment() : Fragment() {
  
  private var workflowId: String? = null
  private var workflowData: WorkflowData? = null
  private var releaseAtStr: String? = null
  
  public fun init(workflowId: String,
                  workflowData: WorkflowData,
                  releaseAtStr: String? = null) {
      this.workflowId = workflowId
      this.workflowData = workflowData
      this.releaseAtStr = releaseAtStr
  }
  
  private var context: BaseActivity? = null
  
  override fun onAttach(context: Context?) {
      super.onAttach(context)
      if (context is BaseActivity?) {
          this.context = context
      }
  }
  
  override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?) =
          inflater?.inflate(R.layout.fragment_approval_details, container, false)
  
  override fun onActivityCreated(savedInstanceState: Bundle?) {
      super.onActivityCreated(savedInstanceState)
      loadingOverlay?.show()
      populateWorkflowHistory()
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Any idea how to fix it or at least reproduce?</p>
  
  <p>Thanks.</p>