E/ModuleIdSetter: exception when setting module id. What does this error mean?

Viewed 4327

I was building an app on android studio and encountered this error E/ModuleIdSetter: exception when setting module id. I have no idea what this error is about and I would like to know what it is and how to resolve it. The full error is below.

2020-07-21 16:07:06.626 28147-28311/? E/ModuleIdSetter: exception when setting module id
    java.lang.IllegalStateException: Unable to get current module info in ModuleManager created with non-module Context
        at com.google.android.chimera.config.ModuleManager.getCurrentModule(:com.google.android.gms@202414040@20.24.14 (120700-319035315):2)
        at aeua.a(:com.google.android.gms@202414040@20.24.14 (120700-319035315):4)
        at aeud.b(:com.google.android.gms@202414040@20.24.14 (120700-319035315):9)
        at aeql.a(Unknown Source:0)
        at rnb.a(:com.google.android.gms@202414040@20.24.14 (120700-319035315):0)
        at rjk.c(:com.google.android.gms@202414040@20.24.14 (120700-319035315):1)
        at rji.b(:com.google.android.gms@202414040@20.24.14 (120700-319035315):1)
        at rlz.b(:com.google.android.gms@202414040@20.24.14 (120700-319035315):6)
        at rlz.c(:com.google.android.gms@202414040@20.24.14 (120700-319035315):6)
        at rlz.b(:com.google.android.gms@202414040@20.24.14 (120700-319035315):10)
        at rlz.a(:com.google.android.gms@202414040@20.24.14 (120700-319035315):17)
        at rlz.g(:com.google.android.gms@202414040@20.24.14 (120700-319035315):3)
        at sbg.a(:com.google.android.gms@202414040@20.24.14 (120700-319035315):2)
        at sag.a(:com.google.android.gms@202414040@20.24.14 (120700-319035315):10)
        at rzx.a(:com.google.android.gms@202414040@20.24.14 (120700-319035315):0)
        at saa.handleMessage(:com.google.android.gms@202414040@20.24.14 (120700-319035315):28)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at aeiw.a(:com.google.android.gms@202414040@20.24.14 (120700-319035315):2)
        at aeiw.dispatchMessage(:com.google.android.gms@202414040@20.24.14 (120700-319035315):14)
        at android.os.Looper.loop(Looper.java:214)
        at android.os.HandlerThread.run(HandlerThread.java:67)
1 Answers

System services not available to Activities before onCreate().

For example

This will throw an exception

private var audioManager = getSystemService(Context.AUDIO_SERVICE) as AudioManager

override fun onCreate(savedInstanceState: Bundle?) {
}

But, this won't

private lateinit var audioManager: AudioManager

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

audioManager = getSystemService(Context.AUDIO_SERVICE) as AudioManager  
}  
Related