Force Close after Splash Screen Activity

Home - Force Close after Splash Screen Activity

Fauziyyah Faturahmah Iskandar asked 2 years ago

Dear Alann Maulana, 
 
Hello, i want to ask about my problem using mesosfer for beacon. The problem is why this app force close while running in background , i’ve been followed the tutorial but cannot open main activity after splashscreen. 🙁
please respone my problem, thankyou
Sincerely, 
Zizi

4 Answers
Alann Maulana Staff answered 2 years ago

Hi Zizi,
Can you send me the logcat when your app getting force close? So we can analyze further about your issue. 
Regards.

Fauziyyah Faturahmah Iskandar answered 2 years ago

Hello Alann, this is my logcat

Start your code here02-02 12:03:53.321 19185-19185/com.eyro.mesosfer.beacon E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.eyro.mesosfer.beacon, PID: 19185
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.eyro.mesosfer.beacon/com.eyro.mesosfer.beacon.MainActivity}: java.lang.ClassCastException: com.eyro.mesosfer.beacon.model.CBeacon cannot be cast to com.eyro.mesosfer.beacon.model.Beacon
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3319)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415)
at android.app.ActivityThread.access$1100(ActivityThread.java:229)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7325)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: java.lang.ClassCastException: com.eyro.mesosfer.beacon.model.CBeacon cannot be cast to com.eyro.mesosfer.beacon.model.Beacon
at com.eyro.mesosfer.beacon.MainActivity.onCreate(MainActivity.java:43)
at android.app.Activity.performCreate(Activity.java:6904)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3266)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415) 
at android.app.ActivityThread.access$1100(ActivityThread.java:229) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:7325) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) 
Alann Maulana Staff answered 2 years ago

Hi Zizi,
From your logcat :

java.lang.ClassCastException: 
  com.eyro.mesosfer.beacon.model.CBeacon cannot be cast to 
  com.eyro.mesosfer.beacon.model.Beacon
  at com.eyro.mesosfer.beacon.MainActivity.onCreate(MainActivity.java:43)

It means that you’re failed to cast CBBeacon object into Beacon object within MainActivity class line 43. Please visit java api description about ClassCastException.
Regards.

Girly Saputri Staff answered 2 years ago

Hi Zizi,
Are you satisfied with Alan’s answer? If yes, then please click the check button to solve this question. 
If you don’t, please let me know what can Mesosfer community do for you.

 

Your Answer