square / cycler

Apache License 2.0
791 stars 27 forks source link

Sample App throws IllegalArgumentException from SimplePage's config (on Recycler.adopt) #42

Closed Nikola-Milovic closed 3 years ago

Nikola-Milovic commented 3 years ago

I tried launching the Sample App as-is from a fresh clone, unfortunately, I keep getting IllegalArgumentException at inline fun <I : Any> adopt( at the very bottom of Recycler.kt. I am not sure what is happening. From my debugging it seems that the layout is lost (I have no idea how), between passing the recycler view to adopt and actually using the recycler view in the function. I've cloned the repository twice to make sure but it could be an error on my end but I am not sure what causes it. I've added the val v =view for debbuging purposes

This is before getting into adopt from SimplePage config l1

This is right after going into adopt l2

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.squareup.cycler.sampleapp, PID: 11779
    java.lang.IllegalArgumentException: RecyclerView needs a layoutManager assigned. Assign one to the view, or pass a layoutProvider argument.
        at com.squareup.cycler.sampleapp.SimplePage.config(SimplePage.kt:117)
        at com.squareup.cycler.sampleapp.RecyclerActivity.onItemSelected(RecyclerActivity.kt:37)
        at android.widget.AdapterView.fireOnSelected(AdapterView.java:957)
        at android.widget.AdapterView.dispatchOnItemSelected(AdapterView.java:946)
        at android.widget.AdapterView.access$300(AdapterView.java:55)
        at android.widget.AdapterView$SelectionNotifier.run(AdapterView.java:910)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        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:930)
luis-cortes commented 3 years ago

This was addressed in v0.1.6. Closing.