Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when select first item #9

Closed
derohimat opened this issue Oct 23, 2020 · 2 comments
Closed

Crash when select first item #9

derohimat opened this issue Oct 23, 2020 · 2 comments

Comments

@derohimat
Copy link

Please complete the following information:

  • Library Version [e.g. v1.0.0]
  • Affected Device(s) [e.g. Nokia 6.1+ with Android 10.0]

Describe the Bug:

  • Running the app
  • Select the first item, I have try at all tabs. All the result same.
  • The app will crash

Crash when select first item

This is the error log

FATAL EXCEPTION: main
    Process: com.skydoves.disneymotions, PID: 18526
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.skydoves.disneymotions/com.skydoves.disneymotions.view.ui.details.PosterDetailActivity}: java.lang.IllegalArgumentException: Required value was null.
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3271)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3410)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2017)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7397)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
     Caused by: java.lang.IllegalArgumentException: Required value was null.
        at com.skydoves.disneymotions.extensions.ActivityExtensionsKt$extraLong$1.invoke(ActivityExtensions.kt:63)
        at com.skydoves.disneymotions.extensions.ActivityExtensionsKt$extraLong$1.invoke(Unknown Source:0)
        at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
        at com.skydoves.disneymotions.view.ui.details.PosterDetailActivity.getPosterId(Unknown Source:2)
        at com.skydoves.disneymotions.view.ui.details.PosterDetailActivity.onCreate(PosterDetailActivity.kt:41)
        at android.app.Activity.performCreate(Activity.java:7802)
        at android.app.Activity.performCreate(Activity.java:7791)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1300)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3246)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3410) 
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) 
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2017) 
        at android.os.Handler.dispatchMessage(Handler.java:107) 
        at android.os.Looper.loop(Looper.java:214) 
        at android.app.ActivityThread.main(ActivityThread.java:7397) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935) 
I: Sending signal. PID: 18526 SIG: 9

Expected Behavior:

Not crash when select first item

@skydoves
Copy link
Owner

Hi, It is fixed in e778981.
Thank you for your issue!

@derohimat
Copy link
Author

You're welcome.

I just fix on different way. I think it's because room can't apply primary key with id 0, but I'm wrong. LoL

Room still working with primary key id 0.

Change the network response to
https://gist.githubusercontent.com/derohimat/46f31d16f4eb1bf8f4703a459fb60b90/raw/00952d35693c640e27a57a3f6a575f8ea069ddae/DisneyPosters.json

also change the DisneyPosters.json to not have 0 id.
It works also.

But your solution very simple.

Thanks for this awesome repo.
I learning MVVM architecture here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants