I have two cases, and both with the simple solution (just rename the method), but they differs with difficulty of reproduction
There is no need to up your target/compile version to fix that problem!
Case 1 (Simple one)
open hyperion-sample project
change compileSdkVersion and targetSdkVersion to 30 (android 11)
compile
Result:
hyperion-core/src/main/java/com/willowtreeapps/hyperion/core/internal/HyperionInitProvider.java:28: error: requireContext() in HyperionInitProvider cannot override requireContext() in ContentProvider
private Context requireContext() {
^
overridden method is final
The problem is that ContentProvider class from android sdk (api 30) already have public final Context requireContext() method that you are trying to override in HyperionInitProvider
Easy fix
rename your private method, e.g. call it requireContextInternal() to avoid that conflict
Case 2 (Can't reproduce on your sample project)
i build my own project with compile/target 28 and using proguard
compile goes well, no errors
but when running on Android 11 devices, app permanently crashes in runtime with exception:
java.lang.LinkageError: Method android.content.Context com.willowtreeapps.hyperion.core.internal.HyperionInitProvider.requireContext() overrides final method in class Landroid/content/ContentProvider; (declaration of 'com.willowtreeapps.hyperion.core.internal.HyperionInitProvider' appears in /data/app/...==/com.myapp-mel9RIQydtXssa_Abcm59g==/base.apk!classes2.dex)
at java.lang.VMClassLoader.findLoadedClass(Native Method)
at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738)
at java.lang.ClassLoader.loadClass(ClassLoader.java:363)
...
Can't reproduce that one on a sample project, but that is really blocking our development process
I have two cases, and both with the simple solution (just rename the method), but they differs with difficulty of reproduction There is no need to up your target/compile version to fix that problem!
Case 1 (Simple one)
Result:
The problem is that ContentProvider class from android sdk (api 30) already have
public final Context requireContext()
method that you are trying to override inHyperionInitProvider
Easy fix
rename your private method, e.g. call it
requireContextInternal()
to avoid that conflictCase 2 (Can't reproduce on your sample project)
Can't reproduce that one on a sample project, but that is really blocking our development process