After updating the support library from v-26.1.0 to v-27.0.0 Multiple errors in my fragments.
here is a list of some these errors:
Error: Smart cast to 'Bundle' is impossible, because 'arguments' is a mutable property that could have been changed by this time.
Error: 'onCreateView' overrides nothing
Error: 'onViewCreated' overrides nothing
Error: Type mismatch: inferred type is View? but View was expected
Error: Type mismatch: inferred type is Context? but Context was expected
Error: Type mismatch: inferred type is FragmentActivity? but Context was expected
Error: Type mismatch: inferred type is FragmentActivity? but Context was expected
from android studio's template for empty fragment.
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (arguments != null) {
mParam1 = arguments.getString(ARG_PARAM1)
mParam2 = arguments.getString(ARG_PARAM2)
}
}
override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View? {
return inflater!!.inflate(R.layout.fragment_blank, container, false)
}
override fun onViewCreated(view: View?, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
}