Forum Xamarin.Android

java.lang.IllegalStateException: No activity

DavidDupuisDavidDupuis USMember ✭✭
edited January 28 in Xamarin.Android

Hello. When I start my app, I get the following exception: java.lang.IllegalStateException: No activity.
Has anyone ever had this problem?

Please find the full exception logs:

[MonoDroid] UNHANDLED EXCEPTION:
[MonoDroid] Java.Lang.IllegalStateException: No activity
[MonoDroid]   --- End of managed Java.Lang.IllegalStateException stack trace ---
[MonoDroid] java.lang.IllegalStateException: No activity
[MonoDroid]     at androidx.fragment.app.FragmentManager.moveToState(:1498)
[MonoDroid]     at androidx.fragment.app.FragmentManager.dispatchStateChange(:2637)
[MonoDroid]     at androidx.fragment.app.FragmentManager.dispatchActivityCreated(:2589)
[MonoDroid]     at androidx.fragment.app.FragmentController.dispatchActivityCreated(:247)
[MonoDroid]     at androidx.fragment.app.FragmentActivity.onStart(:541)
[MonoDroid]     at androidx.appcompat.app.AppCompatActivity.onStart(:210)
[MonoDroid]     at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1440)
[MonoDroid]     at android.app.Activity.performStart(Activity.java:8109)
[MonoDroid]     at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3806)
[MonoDroid]     at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:235)
[MonoDroid]     at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:215)
[MonoDroid]     at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:187)
[MonoDroid]     at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:105)
[MonoDroid]     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2386)
[MonoDroid]     at android.os.Handler.dispatchMessage(Handler.java:107)
[MonoDroid]     at android.os.Looper.loop(Looper.java:213)
[MonoDroid]     at android.app.ActivityThread.main(ActivityThread.java:8178)
[MonoDroid]     at java.lang.reflect.Method.invoke(Native Method)
[MonoDroid]     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
[MonoDroid]     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
[MonoDroid] 
[Process] Sending signal. PID: 9771 SIG: 9

I have a SplashActivity and a MainActivity (attached files).

Answers

  • YelinzhYelinzh Member, Xamarin Team Xamurai

    What's the 'IFireAndForgetSafeAsyncErrorHandler' interface? I tested a basic demo about the function without the interface, it works fine. Try to remove the interface in the project and build to test if the sample will work?

    If it still doesn't work, try adding breakpoints to debug to get which line code cause the error.


    Xamarin forums are migrating to a new home on Microsoft Q&A!
    We invite you to post new questions in the Xamarin forums’ new home on Microsoft Q&A!
    For more information, please refer to this sticky post.

Sign In or Register to comment.