java.lang.IllegalStateException: getResources() or getAssets() has already been called Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of java.lang.IllegalStateException: getResources() or getAssets() has already been called without wasting too much if your time.

The question is published on by Tutorial Guruji team.

I am calling applyOverrideConfiguration(newConfig); inside

@override 
protected void attachBaseContext(Context newBase) {}

with using below dependency:

implementation "androidx.biometric:biometric:1.0.1"

I am obtaining this error : java.lang.IllegalStateException: getResources() or getAssets() has already been called

If I am not using biometric dependency it is working fine without any issue.

Answer

It is a known bug in AndroidX AppCompat version 1.1.0. It has been fixed in version 1.2.0. So If you are using 'androidx.appcompat:appcompat:1.1.0' then upgrade version to 1.2.0

Ref. : https://issuetracker.google.com/issues/140880275

We are here to answer your question about java.lang.IllegalStateException: getResources() or getAssets() has already been called - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji