You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code generated by showkase has a deprecation warning when we update our Android SDK version to 34
public fun Showkase.getMetadata(): ShowkaseElementsMetadata {
try {
val showkaseComponentProvider =
Class.forName("REDACTED").newInstance() // deprecated!!!
as ShowkaseProvider
return showkaseComponentProvider.metadata()
} catch(exception: ClassNotFoundException) {
error("The class wasn't generated correctly. Make sure that you have setup Showkase correctly by following the steps here - https://github.com/airbnb/Showkase#Installation.")
}
}
Added in API level 1 Deprecated in API level 34
public T newInstance ()
This method was deprecated in API level 34. This method propagates any exception thrown by the nullary constructor, including a checked exception. Use of this method effectively bypasses the compile-time exception checking that would otherwise be performed by the compiler. The Constructor.newInstance method avoids this problem by wrapping any exception thrown by the constructor in a (checked) InvocationTargetException .
The call
clazz.newInstance()
can be replaced by
clazz.getDeclaredConstructor().newInstance()
The text was updated successfully, but these errors were encountered:
The following code generated by showkase has a deprecation warning when we update our Android SDK version to 34
The text was updated successfully, but these errors were encountered: