pluto
pluto copied to clipboard
Pluto Not Initialized
Describe the bug I got crash for Pluto is not Initialized, though i have install pluto in application oncreate.
To Reproduce Steps to reproduce the behavior:
// In Application Class
class MainApplication : Application() {
override fun onCreate() {
super.onCreate()
preparePluto(this)
}
}
// Pluto Prepare Function
fun preparePluto(
application: Application
) {
Pluto.Installer(application)
.addPlugin(PlutoNetworkPlugin("exceptions"))
.addPlugin(PlutoExceptionsPlugin("exceptions"))
.addPlugin(PlutoDatastorePreferencesPlugin("datastore"))
.addPlugin(PlutoLoggerPlugin("logger"))
.addPlugin(PlutoSharePreferencesPlugin("sharedPref"))
.install()
Timber.plant(PlutoTimberTree());
PlutoExceptions.setExceptionHandler { thread, throwable ->
Timber.tag("Exception")
.w("uncaught exception handled on thread: ${thread.name} $throwable")
}
PlutoExceptions.mainThreadResponseThreshold = 10_000
PlutoExceptions.setANRHandler { thread, exception ->
Timber.tag("ANR")
.d(exception, "potential ANR detected on thread: ${thread.name} $exception")
}
}
Error Log
Process: com.singularity_code.singularitycodebase, PID: 19298
java.lang.RuntimeException: Unable to create application com.singularity_code.singularitycodebase.MainApplication: java.lang.IllegalStateException: UncaughtExceptionHandler cannot be set as Pluto is not initialised.
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6764)
at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2133)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7872)
\at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Caused by: java.lang.IllegalStateException: UncaughtExceptionHandler cannot be set as Pluto is not initialised.
at com.pluto.plugins.exceptions.PlutoExceptions.setExceptionHandler(PlutoExceptions.kt:38)
at com.singularity_code.codebase.util.PlutoKt.preparePluto(Pluto.kt:31)
\at com.singularity_code.codebase.util.Singularity.EnableFeature(Context.kt:35)
at com.singularity_code.singularitycodebase.MainApplication.onCreate(MainApplication.kt:20)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1277)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6759)
at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2133)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7872)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Expected behavior Not Crashing
Smartphone (please complete the following information):
- Device: Android Phone
- OS: Android (it happens in multiple android version)
- Library Version 2.1.3 , 2.1.5
Additional context Caused by: java.lang.IllegalStateException: UncaughtExceptionHandler cannot be set as Pluto is not initialised.
is this happening always? or occasionally?
it happening right on the initiation process sir. It force me to disable the module until now. i haven't done any further debugging since the error happened.
those lines is where the errors happen
yes it is happen always
i try to add these trials but it never succeed also
is this still happening?