So I recently updated to Android Studio 4.1 and updated my project to Android 10. Ever since, debug app builds work fine but whenever I launch a built APK on an Android device I get the below error:
FATAL EXCEPTION: main
Process: com.cookiegames.smartcookie, PID: 12800
java.lang.IllegalAccessError: Illegal class access: 'androidx.appcompat.widget.ContentFrameLayout' attempting to access 'androidx.appcompat.app.w' (declaration of 'androidx.appcompat.widget.ContentFrameLayout' appears in base.apk)
at androidx.appcompat.widget.ContentFrameLayout.onAttachedToWindow(Unknown Source:7)
at android.view.View.dispatchAttachedToWindow(View.java:18347)
... and so on
I've rolled back to Android Studio 4.0 and moved my project back to SDK 29, but the error persists. I have no idea what to try next.