{"action":"created","issue":{"url":"https://api.github.com/repos/firebase/FirebaseUI-Android/issues/1210","repository_url":"https://api.github.com/repos/firebase/FirebaseUI-Android","labels_url":"https://api.github.com/repos/firebase/FirebaseUI-Android/issues/1210/labels{/name}","comments_url":"https://api.github.com/repos/firebase/FirebaseUI-Android/issues/1210/comments","events_url":"https://api.github.com/repos/firebase/FirebaseUI-Android/issues/1210/events","html_url":"https://github.com/firebase/FirebaseUI-Android/issues/1210","id":308366549,"number":1210,"title":"FirestoreRecyclerAdapter no virtual method getDocument","user":{"login":"jvergers","id":32851353,"avatar_url":"https://avatars2.githubusercontent.com/u/32851353?v=4","gravatar_id":"","url":"https://api.github.com/users/jvergers","html_url":"https://github.com/jvergers","followers_url":"https://api.github.com/users/jvergers/followers","following_url":"https://api.github.com/users/jvergers/following{/other_user}","gists_url":"https://api.github.com/users/jvergers/gists{/gist_id}","starred_url":"https://api.github.com/users/jvergers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvergers/subscriptions","organizations_url":"https://api.github.com/users/jvergers/orgs","repos_url":"https://api.github.com/users/jvergers/repos","events_url":"https://api.github.com/users/jvergers/events{/privacy}","received_events_url":"https://api.github.com/users/jvergers/received_events","type":"User","site_admin":false},"labels":[{"id":234429615,"url":"https://api.github.com/repos/firebase/FirebaseUI-Android/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-03-25T17:04:09Z","updated_at":"2018-03-26T15:46:42Z","closed_at":null,"author_association":"NONE","body":"I am currently converting my Firebase UI components to Firestore UI components. When building the `FirestoreRecyclerAdapter` and manually call the `adapter.startListening()` or initialize it via `new FirestoreRecyclerOptions.Builder().setLifeCycleOwner()` I stumble on the following fatal exception.\r\n\r\n    FATAL EXCEPTION: main\r\n    Process: packagename, PID: 3129\r\n    java.lang.NoSuchMethodError: No virtual method getDocument()Lcom/google/firebase/firestore/DocumentSnapshot; in class Lcom/google/firebase/firestore/DocumentChange; or its super classes (declaration of 'com.google.firebase.firestore.DocumentChange' appears in /data/app/packagename-yHh4aIRPAZwxxRYgunJivQ==/split_lib_dependencies_apk.apk)\r\n    at com.firebase.ui.firestore.FirestoreArray.onDocumentAdded(FirestoreArray.java:98)\r\n    at com.firebase.ui.firestore.FirestoreArray.onEvent(FirestoreArray.java:83)\r\n    at com.firebase.ui.firestore.FirestoreArray.onEvent(FirestoreArray.java:21)\r\n    at com.google.firebase.firestore.zzi.onEvent(Unknown Source:17)\r\n    at com.google.android.gms.internal.zzeyn.zza(Unknown Source:6)\r\n    at com.google.android.gms.internal.zzeyo.run(Unknown Source:6)\r\n    at android.os.Handler.handleCallback(Handler.java:789)\r\n    at android.os.Handler.dispatchMessage(Handler.java:98)\r\n    at android.os.Looper.loop(Looper.java:164)\r\n    at android.app.ActivityThread.main(ActivityThread.java:6809)\r\n    at java.lang.reflect.Method.invoke(Native Method)\r\n    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)\r\n    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)\r\n\r\nThe error states that the class `DocumentSnapshot` doesn't contain a method `getDocument` which after checking is correct. However this is also how the docs states this implementation.\r\n\r\nThe adapter with query\r\n\r\n    mRecyclerView = (RecyclerView) view;\r\n                mRecyclerView.setLayoutManager(new LinearLayoutManager(context));\r\n    \r\n                Query query = mFirestore.collection(\"spots\");\r\n                FirestoreRecyclerOptions<SpotModel> options = new FirestoreRecyclerOptions.Builder<SpotModel>().setQuery(query, SpotModel.class).setLifecycleOwner(this).build();\r\n    \r\n                mAdapter = new FirestoreRecyclerAdapter<SpotModel, SpotHolder>(options) {\r\n                    @Override\r\n                    public SpotHolder onCreateViewHolder(ViewGroup parent, int viewType) {\r\n                        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.card_spot, parent, false);\r\n    \r\n                        return new SpotHolder(view);\r\n                    }\r\n    \r\n                    @Override\r\n                    protected void onBindViewHolder(@NonNull SpotHolder holder, int position, @NonNull SpotModel model) {\r\n                        holder.bind(model);\r\n                    }\r\n                };\r\n    \r\n                mRecyclerView.setAdapter(mAdapter);\r\n\r\nFirebaseUI dependencies\r\n\r\n    implementation 'com.firebaseui:firebase-ui-auth:3.2.2'\r\n    implementation 'com.firebaseui:firebase-ui-database:3.2.2'\r\n    implementation 'com.firebaseui:firebase-ui-firestore:3.2.2'\r\n\r\nThe adapter is being initialized in the `onCreateView` method of a fragment."},"comment":{"url":"https://api.github.com/repos/firebase/FirebaseUI-Android/issues/comments/376213650","html_url":"https://github.com/firebase/FirebaseUI-Android/issues/1210#issuecomment-376213650","issue_url":"https://api.github.com/repos/firebase/FirebaseUI-Android/issues/1210","id":376213650,"user":{"login":"jvergers","id":32851353,"avatar_url":"https://avatars2.githubusercontent.com/u/32851353?v=4","gravatar_id":"","url":"https://api.github.com/users/jvergers","html_url":"https://github.com/jvergers","followers_url":"https://api.github.com/users/jvergers/followers","following_url":"https://api.github.com/users/jvergers/following{/other_user}","gists_url":"https://api.github.com/users/jvergers/gists{/gist_id}","starred_url":"https://api.github.com/users/jvergers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvergers/subscriptions","organizations_url":"https://api.github.com/users/jvergers/orgs","repos_url":"https://api.github.com/users/jvergers/repos","events_url":"https://api.github.com/users/jvergers/events{/privacy}","received_events_url":"https://api.github.com/users/jvergers/received_events","type":"User","site_admin":false},"created_at":"2018-03-26T15:46:42Z","updated_at":"2018-03-26T15:46:42Z","author_association":"NONE","body":"Downgrading Firebase to `11.8.0` worked as a temporarily work around, will keep an eye on the update. Thanks a million!"}}
{"actor":{"display_login":"jvergers"}}